Using Rename or mv to rename your files is one part of the solution. The other part would involve
reading the data from your spread sheet/document.
There are many ways to accomplish that second part, but one of the easiest would be:
1. Copy the contents of your spread sheet/word doc in a plain text file, preferrably specifying the original
name & it's corresponding new name on the same line. The delimiter between both columns is rather
irrelevant.
Alternatively, if the spreadsheet has 2 columns (with old and new names), try saving your spreadsheet in
csv (comma separated values) format. This would accomplish putting the old/new name pairs, each on a
separate line, using ',' as delimiter.
2. Write a simple script to iterate over each line in the plain text file. Use 'cut' to extract both file names
and 'mv' to do your renaming.
Basically, this script would look somthing like (if the delimiter isn't a space or tab):
Code:
#!/bin/bash
DELIM='your_delimiter';
for i in `your_plain_file`; do
old_name=`cut -d"${DELIM}" -f1`; #assuming your old file names are in first column
new_name=`cut -d"${DELIM}" -f2`; #and new names are in second (if the other way around, switch the -f
#options)
mv ${old_name} ${new_name}
if (( $? != 0 )); then
echo "mv ${old_name} ${new_name} failed.";
fi;
done;
You may want to replace "mv" by "echo", just to see if the script would rename exactly the way you'd like it to, before actually renaming anything.