Renaming a File

Advanced Renamer forum
#1 : 15/08-22 16:30
Srinivasa Mannava
Srinivasa Mannava
Posts: 1
Hi, I have list of filenames with a separator '_' in the filename , I would like to replace the file name with the value between the 1st separator and 2nd separator.

Example:
File Name : XYZD1_newfilename_njAHDKH_TEST234.pdf should be replaced as newfilename.pdf

Is it possible with Advanced Renamer. If yes, How to do this or which method to be used.

Best Regards,
Srini


15/08-22 16:30
#2 : 19/09-22 20:20
L B
L B
Posts: 74
Reply to #1:

Assuming you always have 3 separators in your original file name:

New Replace Method --> Tick on 'Use Regular Expressions'.

Text to be replaced : ^(.*)_(.*)_(.*)_(.*)
Replace With : \2

Apply to : Name


19/09-22 20:20
#3 : 25/09-22 14:29
David Lee
David Lee
Posts: 1125
Reply to #1:

Replace: [^_]*_([^_]*).*
with: \1


25/09-22 14:29