thank you for the script I took the first responders advice and downloaded MacRename which turned out pretty helpful
I'm now digesting your rollyourown script Cheers ptarmigan On Oct 4, 3:40 pm, Tim Gray <[EMAIL PROTECTED]> wrote: > This should be very easy to whip up with a shell script. I have > something very similar already written, but it renames files in the > format basename_counter.ext instead of just counter.ext. I'll paste > it below so you can see how its done (delimited by ------). One could > modify it to do what you want. > > shell script: > ------ > #! /bin/sh - > ##This shell script takes all jpgs in a directory and changes their > ##names to a basename+counter.jpg. The files are ordered oldest > first. > > i=1 > > if [ -z "$@" ] > then > echo "You must supply a basename." > exit 1 > else > for file in `ls -1 -r -t *.jpg` > do > mv $file "[EMAIL PROTECTED]((i++)).jpg" > done > fi > ------ > > However, I have a bit more complicated python script that does what > the above shell script does, and also operates on any file extensions > that you might want, will use a basename or not, can add a suffix > after that counter, and can also zero pad the counter. I've included > that to. For your usage, you would call "rename.py jpg" and it will > rename all the jpgs in the current directory to counter.jpg. If you > use the -t option, it will print out all the proposed name changes > without actually renaming files. Use the -h option to read the brief > help. I will warn you that it orders the files using a natural sort > algorithm (essentially alphabetical but gets numbers right). > > http://125px.com/misc/rename.py > ^^^Save this to a file named rename.py, put it in your path and chmod > 755 rename.py. > > On Oct 3, 9:11 am, psquillace <[EMAIL PROTECTED]> wrote: > > > I have used a program called file renamer to do this but it is only > > for windows os at the time...... you can find the program > > herehttp://www.sherrodcomputers.com/products_filerenamer.cfm > > > I would just look for a mac file renaming program instead of writing a > > script to do it, unless it is for a client or someone who is paying > > you. > > > hope this helps, > > > On Oct 3, 8:33 am, Ptarmigan <[EMAIL PROTECTED]> wrote: > > > > hi > > > > i've a load of .jpg files to rename > > > > I want to name them 1.jpg, 2.jpg, 3.jpg etc > > > > cld s.o kindly point me to a simple bash worksheet script wh wld do > > > this for me > > > > i'm looking at 100s of files > > > > ptarmigan ((Palin-roadkill)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To post to this group, send email to bbedit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a specific feature request or would like to report a suspected (or confirmed) problem with the software, please email to "[EMAIL PROTECTED]" rather than posting to the group. -~----------~----~----~----~------~----~------~--~---