Hi, I would like to change the names of the files in a directory with a script.
example:
I have a directory that contains 20 files:
‘City (1) .doc’ which must become ‘city - London.doc’
‘City (2) .doc’ which must become ‘city - Paris.doc’
‘City (3) .doc’ which must become ‘city - Roma.doc’
Etc…. until
locations (20) .doc
I have a “NEW-NAMES.txt” file which contains 20 names:
London
Paris
Rome
etc … up to the twentieth name
the names of the file “NEW-NAMES.txt” are already progressively organized to be replaced
city (1) is renamed with London which is the first name which is dell file “NEW-NAMES.txt”
city (2) is renamed with Paris which is the second name of the file “NEW-NAMES.txt”
city (3) is renamed with Rome which is the third name of the file “NEW-NAMES.txt”
etc…
basically the word
‘City’ remains unchanged while the parenthesis with the number
‘(1) ’must be replaced by’ - ‘and the word’ London ‘(found in the’ NEW-NAMES.txt 'file
once renamed the new file should be:
city - London.doc
city - Paris.doc
city - Rome.doc
etc. etc.
I hope I was clear
in the explanation, despite my bad english
Can you help me?
Thank you all!