in AppleScript: Nem
in Perl: here and here (Linux)
my favorite is a loop in Unix to rename file extensions:
1) if you know what your extensions are:
#!/bin/bash
for i in *fasta
do
mv "$i" "`echo $i | sed -e 's/fasta/fas/'`"
done
for i in *fas
do
cat "$i" | sed -e 's/\.fasta\"/\.fas\"/g' > out
mv out "$i"
done
2) if you prefer an interactive script that will ask you what extension names you want to change from/to:
#!/bin/bash
echo -n "enter old: "
read old
echo -n "enter new: "
read new
for i in *.$old
do
mv "$i" "`echo $i | sed -e "s/$old/$new/"`"
done
The shell scripts were kindly written by my friend Ricardo Baratto