replace n-th occurrence of '-' with '' ?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

replace n-th occurrence of '-' with '' ? Fri Nov 25, 2016 9:09 pm • by panini
Hi,

I'd like to modify Screenshot file names.
They come like this:
Screenshot_2016-08-13-10-29-07.jpg

I need them modified to:
20160813_102907.jpg

- stripping of 'Screenshot' with a 1st rule worked ok
- but how do I replace the 3rd '-' with '_' ?
before replacing '-' with '' ?

Thanks for helping out!
panini
 
Posts: 23
Joined: Mon Dec 08, 2014 6:54 pm

Re: replace n-th occurrence of '-' with '' ? Mon Nov 28, 2016 12:37 pm • by Mr_Noodle
You can't use Replace text for that in this case. Instead, you might want to use custom attributes to match the portion before and after the '-'. When renaming, you can then use those custom attributes but use a '_' instead.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: replace n-th occurrence of '-' with '' ? Mon Nov 28, 2016 1:12 pm • by panini
Sorry for my ignorance, but can you reveal a bit more? Is there some example available?
Can I somehow use YYYY-MM-DD for example?
panini
 
Posts: 23
Joined: Mon Dec 08, 2014 6:54 pm

Sorry about that. Search the help for "match patterns" which should explain all you need to know on this. Report back here if you are having specific problems with it.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support