I have several hundred files with data looking like this
1.jpg
2.jpg
3.jpg
4.jpg
13.jpg
I need to replace with
nnu1.jpg
nnu2.jpg
nnu3.jpg
nnu4.jpg
nnu13.jpg
Also is there a way I can pass Textpad the name of the folder the file is in?
So using the same example
1.jpg
2.jpg
3.jpg
4.jpg
13.jpg
would become
Foldername1.jpg
Foldername2.jpg
Foldername3.jpg
Foldername4.jpg
Foldername13.jpg
Thanks
Find numerical pattern replace with Text + numerical pattern
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
If you want to replace every instance of n.jpg, where n is any number with any number of digits and where n.jpg is the entire file name, try this:
If you want to replace every instance of n.jpg at the beginning of a line, where n is anything at all, try this:Find what: \<[0-9]+\.jpg
Replace with: nnu\0
[X] Regular expression
You can copy the full path and name of the current file to the clipboard with Edit | Copy Other | File Name. To get the path part you'll have to remove the final file name component.Find what: ^.*.jpg
Replace with: nnu\0
[X] Regular expression