Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

applications that rename multiple files?

Name: Anonymous 2005-09-15 4:30

anyone know of any programmes that would allow me to re-name multiple file's names? something like, naming several dozen files that has random numbers as its filename to something like something_01, something_02, something_03 and such?

Name: Anonymous 2005-09-15 4:42

Irfanview, for one.

Or bash for the insane.

Name: Anonymous 2005-09-15 5:54

You think this is insane?

( COUNT=0; for FILE in *; do mv "$FILE" `printf "something_%02d" $COUNT`; let COUNT++; done; )

Maybe it is.

Name: Anonymous 2005-09-15 9:58

>>1
You usually want these files renamed to something like their CRC, so you don't have two files with the same name. I have some utilities for that.

>>3
It definitely is. I'd rather use Perl as it's less insane, and if I'm feeling particularly polite, I'd use PHP CLI.

Here's the Perl equivalent:
system(sprintf("echo move $_ something_%02d", $i++)) while (<*>)

Name: Anonymous 2005-09-15 9:59

Er, remove echo (didn't want to screw my stuff), and use mv if you aren't running Windows or have it aliased.

Don't change these.
Name: Email:
Entire Thread Thread List