On Mon, Mar 3, 2008 at 6:53 PM, Greg Freemyer
All,
I have a directory with several hundred files in it. All in alphabetical order the way I need them.
I need to rename them to be in a totally different sequence.
ie. Currently nnn_mmm_lll.tif
Need to rename AAA_xxxx.tif where AAA is fixed, and xxxx is sequence I can specify the starting point for.
I'm about to write a shell script to do this, but would be nice to have a pre-existing tool I could call on. mmv is close I think, but I don't know how to do the sequence number with it.
Thanks Greg
Still hoping for a better solution, but here is the bash script I came up with as a starting point. It works for this one time. I'll tweak it more if I have to reuse it. #!/bin/bash SOURCE=orig DEST=renamed START=2076 PREFIX=KGI-00 SUFFIX=.tif mkdir $DEST ls $SOURCE > source-list while read source ; do echo cp $source $DEST/$PREFIX$START$SUFFIX cp "$source.tif" $DEST/$PREFIX$START$SUFFIX START=`expr $START + 1`; done < source-list Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org