Today I was faced with the problem that I had to rename many files (about 10.000) from upper-case to lower-case. With the unix command line no bigger problem, but try it with Windows.
After a little research in the WWW in found this: 1-4a rename - a great tool for my needs.
If you are faced with the same problem try it - it is worth the minutes to get used to it and the good examples will serve you.

Kommentare (1)
Ein Arbeitskollege (Unix-Experte) hat mir ein geniales Shell-Skript geschrieben, dass diese Arbeit verfeinert und noch zusätzliches (CVS Arbeit) leistet.
Hier ist es:
#!/bin/sh
find 9PAAG7 9PAAH7 9PAAI7 -type f -name '*.[Jj][Pp][Gg]' | while read f
do
dir=$(dirname $f);
file=$(basename $f);
case "$file" in
*_innenraum*)
n1=$(echo $file | cut -c1-2 | tr '[:upper:]' '[:lower:]');
n2=$(echo $file | cut -c3-)
file_neu="$n1$n2";
;;
*)
file_neu=$(echo $file | tr '[:upper:]' '[:lower:]');
;;
esac
{
echo "cd $dir;"
echo "mv $file $file_neu;"
echo "cvs remove $file;"
echo "cvs add $file_neu;"
} | sh -x
done
Danke @Klemens :)
Von Tobias | 11.05.07 15:56
Geschrieben am 11.05.07 15:56