Page 1 of 1

how can I change file names using some kind of expression?

Posted: Mon Nov 20, 2006 11:24 am
by winniethetwo
Hi all!
I have to change the file name to load of files,for example my files name are something like

newyork_usa.jpg
rome_ita.jpg
london_eng.jpg

...

I know that all the files are jpg and have an underscore and 3 digits after that.
I just want to remove the underscore and the 3 digits, so the new file list will be

newyork.jpg
rome.jpg
london.jpg

can anyone help me? maybe wildedit isn't the correct software to do that, have you an alternative sw to suggest?

please note that I've got files, this is not a text file with those name inside it!

thanks for your attentions!

Posted: Mon Nov 20, 2006 12:52 pm
by ben_josephs
WildEdit and TextPad are editors designed for editing the contents of text files.

You can put the names of the files you want to rename into a file, called, say, renamejpg.bat, and then edit that file, using WildEdit or TextPad, and turn it into a batch file that you can run from the command line.

In WildEdit:
Find what: (.*)_...\.jpg
Replace with: ren $0 $1.jpg

[X] Regular expression
[X] Replacement format
In TextPad:
Find what: (.*)_...\.jpg
Replace with: ren \0 \1.jpg

[X] Regular expression

This assumes you are using Posix regular expression syntax:

Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Posted: Fri Apr 06, 2007 11:12 am
by ibily
Excelent and free Ant Renamer (www.antp.be/software/renamer) could be your solution.