Rename to fixed filename

Post variable and regex related tips, questions.

Rename to fixed filename

Postby melvin » Sun Sep 08, 2013 8:56 am

User question:

We are using jasftp for many file transfers and now I need to rename a file that we are receiving daily.

So my question is “how can I rename a file from TESTD130806.TXT to TEST.TXT ”.
melvin
Site Admin
 
Posts: 979
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Postby melvin » Sun Sep 08, 2013 8:56 am

1) If the filename contains todays date, then use the date variable:
Filename field: TESTD$%DATE::yyppdd%$.TXT (case sensitive)
Rename field: TEST.TXT

2) If the filename contains any previous date, use regex to match any 6 numbers
Filename:
REGEXF=TESTD[0-9]{1,}.TXT

Rename Filename:
Rename field: TEST.TXT
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 3 guests

cron