Adding a Prefix to a Filename Using Operation Masks

Advertisement

esan
Joined:
Posts:
1
Location:
Seattle WA

Adding a Prefix to a Filename Using Operation Masks

I am trying to use the masks into to rename each file on the local machine such that they are prefixed with a string.

I have a terribly simple script which uses the get command to copy all files with a txt.gz extension that are in each of the directories of the remote machine (that start with a numeric), into a local directory.

e.g.

option include "[1-9]*/; *.txt.gz"
get * C:\feeds\companyA

remote machine directory & name local machine directory & name
1dir/12113.txt.gz C:\feeds\companyA\12113.txt.gz
2dir/55225.txt.gz C:\feeds\companyA\55225.txt.gz

This works great. However, what I would like is for the local file names to be prefixed with a string,
e.g. C:\feeds\companyA\sample12113.txt.gz.

I have tried many different ways, but all end up either chopping off some of the numbers in the filename, or creating subdirectories I don't need.

Obviously, I could just do this with a shell script, but I would love to do it in this one command. Is this possible?
I can provide examples of what I have attempted if it would help.

Thanks!

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum