I'm trying to rename multiple numbered files according to a list of names.
Example:
1.pdf, 2.pdf, …, n.pdf
And a file called names.txt
, with a value per line:
Fabio
Joao
n-name
So we will have
1.pdf
→Fabio.pdf
2.pdf
→Joao.pdf
n.pdf
→n-name.pdf
Any ideas on how to accomplish this?
names.txt
go to the first, sorting alphabetically ascending, existing filename? Or you have another fileold_names.txt
that matches one to one the newnames.txt
?