Program for batch renaming of files...

zsouthboy

Regular
I have about 1000 different files that need to have their filenames truncated at the first space... (e.g. "123-TH-098 Product Name.txt" needs to become "123-TH-098.txt")

I've tried Useful File Utilities (and looked for plugins to do this for me too), and it doesn't provide this functionality.

Anyone know of a program that'll do this for me?

In reality, I can whip up something in C++ that'll do this for me, but time is of the essence, so if there's already a program available, I'd like to use that.


Suggestions?
 
Okay I'm running into the same problem with this as I did with Useful File Utilities:

The number of digits of the catalog number is not constant. Therefore, trying to keep the first 7 characters from the filename won't work. Hence I specifically need to truncate at the first space....

Good program though, I'll keep it around for other things...
 
Okay i'm doing it using a combination of AF5 Rename your Files and THE Rename...

I'm using the "separate words" option of THE Rename to push the first space over far enough so that I can truncate to the furthest character that i want to keep. Then I use AF5 to actually do the truncation. Then I use THE Rename to "remove internal spaces". Works much better than doing it by hand.

Thanks guys! :)
 
Ah, I just made you a proggie that does what you want:

I called it renx.

But I guess I was too slow :D
 
DiGuru said:
Ah, I just made you a proggie that does what you want:

I called it renx.

But I guess I was too slow :D


Holy crap that works awesome!

Thanks so much, I hadn't done it yet, this'll work great!

You have my eternal gratitude.

:)
 
OK, I know I'm two weeks late here, but I just had to pop in. :D

A real geek would start up his xterminal (or cygwin if he's in windows), and write something like:
Code:
du -a | awk '{match($0,"([0-9]+[ \t]+)(.[-_./ [:alnum:]]*/[-_.[:alnum:]]+)( [-_. [:alnum:]]*)([.][[:alnum:]]*)",a); if(a[0]) system("mv \""a[2] a[3] a[4]"\" \"" a[2] a[4]"\"")}'

And then pray to god that he typed it right. :? :D
(I haven't tested it, so I don't take any responsibility for any files lost.)
 
Back
Top