Hi TC-experts!
I have a bunch of files I need to rename. In the filename, I need to extract a specific string (5 numbers followed by xx) and put it into the beginning of the file, e.g.
(current name -> new name)
blablabla12345xxblablabla.jpg -> 12345xxblablablablablabla.jpg
bla98765xxblablabla.jpg -> 98765xxblablablabla.jpg
I guess this is a RegEx thing and I haven't been able to find the right way to do this. Can anyone help with the correct search/replace?
All the best,
Rasmus
Renaming / swap in file name.
Moderators: white, Hacker, petermad, Stefan2
Re: Renaming / swap in file name.
FROM:
ABCDEF12345xxGHIJK.jpg
XYZ98765xxMNOPQ.jpg
TO:
12345xxABCDEFGHIJK.jpg
98765xxXYZMNOPQ.jpg
USE MRT:
Search: (.+)(\d{5}xx)(.+)
Replace: $2$1$3
[x]RegEx
ABCDEF12345xxGHIJK.jpg
XYZ98765xxMNOPQ.jpg
TO:
12345xxABCDEFGHIJK.jpg
98765xxXYZMNOPQ.jpg
USE MRT:
Search: (.+)(\d{5}xx)(.+)
Replace: $2$1$3
[x]RegEx
Re: Renaming / swap in file name.
Fantastic - thanks Stefan2!