#1 : 22/03-18 11:11 Ian Taylor
Posts: 4
|
I have multiple files, all end with -DDMMYY.JPG
I want to change this to _DDMMYY.JPG The location of the last - changes - sometimes it's 3rd, sometimes, 4th, etc so the easiest way is to find and replace the last time the - appears, swapping it to _ How can I do this please? Thanks, Ian |
#2 : 22/03-18 19:12 Stefan
Posts: 274
|
Reply to #1:
FROM: xxxx-DDMMYY.JPG xxxx-xx xxxx-DDMMYY.JPG xxxx-xxxx-xxxx-DDMMYY.JPG TO: xxxx_DDMMYY.JPG xxxx-xx xxxx_DDMMYY.JPG xxxx-xxxx-xxxx_DDMMYY.JPG Plain English: Replace very last occurrence of a hyphen to a underscore. Try: Replace method https://www.advancedrenamer.com/user_guide/metho d_replace with greedy RegEx match: https://www.advancedrenamer.com/user_guide/regul ar_expresions Find: (.+)-(.+) Replace: \1_\2 [x] Use regular expressions Apply To [Name] |
#3 : 26/03-18 10:38 Ian Taylor
Posts: 4
|
Reply to #2:
Okay, so it seems you suggest I place some coding from the second link, into the TEXT TO BE REPLACED and REPLACE WITH boxes, therefore sidestepping the Occurence box relaying on exact positioning. That's fine - except I am having trouble deciphering the RegEx language/expressions so, for speed; please can someone tell me what to type into TEXT TO BE REPLACED and REPLACE WITH to change this; FIRST-SECOND-THIRD-HOMEPAGE-110517 to this; FIRST-SECOND-THIRD-HOMEPAGE_110517 which would word on the final hyphen on any length of filename with this end format; -DDMMYY Thanks, Ian |
#4 : 26/03-18 13:12 Mark
Posts: 175
|
Reply to #3:
Add method - Replace Text to be replaced: (.+)-(.+) Replace with: \1_\2 Occurrence: All Case sensitive: not ticked Use regular expressions: ticked Apply to: Name This converts FIRST-SECOND-THIRD-HOMEPAGE-110517 to FIRST-SECOND-THIRD-HOMEPAGE_110517 and xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-DDMMYY.JPG to xxxx-xxxx-xxxx-xxxx-xxxx-xxxx_DDMMYY.JPG You should see the New Filename in the main screen ...... |
#5 : 26/03-18 13:26 Ian Taylor
Posts: 4
|
Reply to #4:
Awesome, lemme try. Read through your posts on the process and code/expressions but I'm new to this one so having trouble deciphering the logic vs what's typed. |
#6 : 26/03-18 15:47 Ian Taylor
Posts: 4
|
Reply to #4:
Worked perfectly - thank you! |
#7 : 26/03-18 16:59 Mark
Posts: 175
|
Reply to #6:
Thanks to Stefan, he's the RegEx whizz :) |