: How do you generate a list of filenames?
I have spoken in the past about the wonders of emacs macros. You can easily chop up and merge multiple lists to generate a shellscript to create filenames in a particular format. For example, suppose you have this:
You can do something like the following:
ls *.jpg > x.sh
nl -n rz -v 0 -w 6 x.dat
... use an emacs macro to merge these two lists ...
resulting in a file x.sh that looks something like this:
mv foo_3_87.jpg img_000000.jpg
mv goo_9_36_joe.jpg img_000001.jpg
mv marysfilename.jpg img_000002.jpg
Run: sh -x x.sh
and Bam! there you have it ;)
The nl command is nice because it generates zero-padded text strings for you. 1 (15-07-2012)