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

General questions about using WildEdit

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
winniethetwo
Posts: 1
Joined: Mon Nov 20, 2006 9:01 am

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

Post 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!
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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
ibily
Posts: 1
Joined: Fri Apr 06, 2007 11:01 am

Post by ibily »

Excelent and free Ant Renamer (www.antp.be/software/renamer) could be your solution.
Post Reply