Hello,
We have files ( named in the following format ) in one of our folders:
MV0001.XLS
MV0002.XLS
and so on
WV0001.XLS
WV0002.XLS
and so son
CV0001.XLS
CV0002.XLS
and so on
We need a script that will rename the files in the following way:
if filename starts with 'M', rename file to " XXXXX_SERVER1_Y YYY_MM"
( where 'XXXXX' are the 2nd - 6th characters of the original file name e.g.V0001,
V0002 etc,
'AA' are constant texts,
'YYYY' is current year,
'MM' is previous month )
similarly, if filename starts with 'W', rename files to "XXXXX_SERVER2_ YYYY_MM" , and if it starts with
'C', rename to "XXXXX_SERVER3_ YYYY_MM".
Any help will be greatly appreciated.
We have files ( named in the following format ) in one of our folders:
MV0001.XLS
MV0002.XLS
and so on
WV0001.XLS
WV0002.XLS
and so son
CV0001.XLS
CV0002.XLS
and so on
We need a script that will rename the files in the following way:
if filename starts with 'M', rename file to " XXXXX_SERVER1_Y YYY_MM"
( where 'XXXXX' are the 2nd - 6th characters of the original file name e.g.V0001,
V0002 etc,
'AA' are constant texts,
'YYYY' is current year,
'MM' is previous month )
similarly, if filename starts with 'W', rename files to "XXXXX_SERVER2_ YYYY_MM" , and if it starts with
'C', rename to "XXXXX_SERVER3_ YYYY_MM".
Any help will be greatly appreciated.
Comment