Rename from vaying filename to fixed filename

Post variable and regex related tips, questions.

Rename from vaying filename to fixed filename

Postby melvin » Mon Jan 12, 2015 9:08 am

user support request:
Thanks again for your prompt reply. I got another question where I can’t rename a file. The filename will be change everyday and it seems my expression on the filename field is not correct. How can I rename such files if the filename is keep on changing everyday? We got a lot of this task that we need to move and rename the files. Many thanks in advance for your help.

Original name: B Statement - PDF - 20151211-123478996-9765432.PDF
Desired name: IHK_1211.PDF (where 1211 is previous day in Month+day format)
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Re: Rename from vaying filename to fixed filename

Postby melvin » Mon Jan 12, 2015 9:11 am

user resolved this issue himself :)

Ignore my query, I got it. Should be like this..
Filename field: REGEXF=Bank Statement - PDF-[0-9]{1,}-[0-9]{1,}-[0-9]{1,}.PDF
Rename field: IHK_$%DATEADDX::ppdd::dd::-1%$.PDF

i.e. use the DATEADDX variable to get previous day in desired format.
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california


Return to Variables and Regular Expressions

Who is online

Users browsing this forum: No registered users and 1 guest

cron