hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Renaming of files

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
mcatmull@scripnet.com



Joined: 29 Oct 2009
Posts: 20

PostPosted: Wed Jun 30, 2010 10:35 am    Post subject: Renaming of files Reply with quote

I am attempting to rename a file but it fails and retains the original files after the FTP task is run.

The original filename is: xxx_xxx_YYYYMMDD_HHMISS.txt where (YYYY is the 4 digit year; MM is the 2 char month number; DD is the day; HH is the hour; MI is the minute; and SS is the seconds.

I would like to rename the file to "zzzMMDDYYYY.txt" (where zzz is some fixed value).

I attempted the following in the rename field:
zzz$%DATE::ppddYYYY%$.txt

Can someone tell me where I am going wrong?
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Sat Jul 03, 2010 9:37 am    Post subject: Reply with quote

$%DATE::ppddYY%$

should be correct. YY not YYYY

which version are you using?


Also, make sure rename option is selected. Most commonly overlooked.
Back to top
View user's profile Send private message
mcatmull@scripnet.com



Joined: 29 Oct 2009
Posts: 20

PostPosted: Tue Jul 06, 2010 6:26 pm    Post subject: Reply with quote

Robert: Thanks for pointing out the problem with YYYY format mask. That was actually a typo on my part.

The version I am using is: 8.26 (Enterprise)

The problem I am having (and that was not clearly stated) is that I would like to replace the "xxx_xxx" portion of the filename with the "zzz" fixed string.

So, for example, if I have abc_def_20100706_140533.TXT and I want it to be ghi20100706.TXT. Is this possible?
Back to top
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 635
Location: Santa Barbara, california

PostPosted: Sat Jul 10, 2010 2:45 pm    Post subject: Reply with quote

if 20100706 is the current date, in the rename field use:
ghi$%DATE::YYppdd%$.TXT
Back to top
View user's profile Send private message Send e-mail
mcatmull@scripnet.com



Joined: 29 Oct 2009
Posts: 20

PostPosted: Sat Jul 10, 2010 3:41 pm    Post subject: Reply with quote

I had tried this but the problem may be because I am attempting to use the RENAME field in a DECRYPT task and it appears that the rename does not work.

NOTE: The RENAME field had the following: CLIENT$%DATE::YYppdd%$.TXT

I tried to do the DECRYPT using the same folder for both the source and the target. The task log informed me that there was an error in renaming the folder because the source and target files were the same. The file was decrypted and "renamed" to have a pgp_1 file extension but the filename itself was not changed.

I then tried moving the file to a different folder. Basically the same thing happened except there was not an "_1" appended the the file extension name (.pgp).

I thought it could be that the filename had two periods in the name (i.e., CLIENT_EDC2_20100709_20001800.DAT.pgp). I removed the ".DAT" from the filename, but the rename still was ignored and the file was decrypted as CLIENT_EDC2_20100709_20001800.pgp

Can you see where I am going wrong or think of anything else may helpl with this.[/b]?
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Thu Jul 15, 2010 2:33 pm    Post subject: Reply with quote

what is your entry in the filename field?
Back to top
View user's profile Send private message
mcatmull@scripnet.com



Joined: 29 Oct 2009
Posts: 20

PostPosted: Thu Jul 15, 2010 2:50 pm    Post subject: Reply with quote

I am using a wild card: *.txt.
[/b]
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Mon Jul 19, 2010 11:33 am    Post subject: Reply with quote

for the filename field try:
REGEXF=[a-zA-Z]{1,}_[a-zA-Z]{1,}_[0-9]{1,}_[0-9]{1,}.txt


also .txt is cap sensitive.. so be careful with .txt or .TXT
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group