I will be downloading a file every day with the name in this format
SCA20060303_17514_IN.TXT
And I need to rename it to
SCA20060303_IN.TXT
Where "20060303" is the current date, and the "_17514" part will always be a 5-digit number that I will NOT know beforehand. I just need to take it out.
I've always used the mv filename1 filename2 command to rename files but how can I do this if I don't know the exact original name of the file?
vgersh99, it seems to me that with nmap you are assigning values to variables ($1 and $3 in your example) and using those variables to re-format the string.
However, I did just realize that I also have to rename the _IN.TXT to lowercase. Does this mean the 2nd option is better?
to map all CAPs to low case....
You can play with either 'nmap' and/or 'macdef' to get the desired result OR go the 'post processing' route, but it might interesting to figure out how to do it natively within ftp.