Rename with GROUP

Post variable and regex related tips, questions.

Rename with GROUP

Postby melvin » Thu Jan 29, 2015 9:34 am

User support request:
In my clients SFTP server are the following files
1. T1400402334901-00000015855.ready
2. T1400402334902-00000015855.ready
3. T1400402334903-00000015855.ready
4. T1400402334904-00000015855.ready
5. T1400402334905-00000015855.ready
6. T1400402334906-00000015855.ready
7. pp_vss_498807_20141215080203.ready

I would like to get these files and rename them to
1. get file 1 above and rename to T1400402334901.txt
2. get file 2 above and rename to T1400402334902.txt
3. get file 3 above and rename to T1400402334903.txt
4. get file 4 above and rename to T1400402334904.txt
5. get file 5 above and rename to T1400402334905.txt
6. get file 6 above and rename to T1400402334906.txt
7. get file 7 above and rename to pp_vss_498807.txt.
Would you be able to help me with some scripts and instructions how I could achieve this objective.??
melvin
Site Admin
 
Posts: 981
Joined: Thu May 25, 2006 10:20 am
Location: Santa Barbara, california

Re: Rename with GROUP

Postby melvin » Thu Jan 29, 2015 9:34 am

Use a Copy Task with following settings:
select Rename Option
Filename field: .ready
Rename field: ([a-zA-Z0-9_]{1,})<GROUP>group1.txt
melvin
Site Admin
 
Posts: 981
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 2 guests

cron