by Stefan » Fri Jun 07, 2013 6:31 pm
FROM:
File10203_001.txt
File10204_004.txt
File10_222_201.txt
pic200302333_082.jpg
pic200305_502.jpg
pic_20030201_022.jpg
TO:
File10203 (1).txt
File10204 (4).txt
File10_222 (201).txt
pic200302333 (82).jpg
pic200305 (502).jpg
pic_20030201 (22).jpg
Rule:
Match 1:(everything greedy) till 2:(last underscore followed by none-or-more zeros) and 3:(one-or-more digits).
Drop underscore and leading zeros and put remaining number into parentheses.
Store first match into backreference group "\1", don't store second match as we drop it anyway, store third match into group "\2"
Replace with what is matched in group \1, add space and parentheses yourself, then add what was matched in group \2.
TRY:
RegEx(1)
Match: '(.+)_0*(\d+)'
Repla: '\1 (\2)'
Note:
Don't use the single quotes in real.
Test always with copies of your real files and be sure to have a backup.
.