Rename filename with regular expression

Started by Fulco, June 19, 2016, 06:29:07 AM

Previous topic - Next topic

Fulco

How can I strip the first 4 characters, add a 6 digit substring and add a suffix at the same time?

All of the concerning filenames have the same format, for example: IMG-20160523-WA0006.jpg
The format I need is: 20160523140000-WA0006_received.jpg

I came not further than this:
exiftool '-TestName<${FileName;s/IMG-(\d{8})-([A-Za-z]+)(\d{4}).*/$1-$2$3_received/}.%e'

The regular expression will not match anymore if "140000" is added: 
exiftool '-TestName<${FileName;s/IMG-(\d{8})-([A-Za-z]+)(\d{4}).*/$1140000-$2$3_received/}.%e'

Is it possible to add this substring some way? Thanks in advance.

- Fulco

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Fulco

Thank you! I really appreciate your help.

- Fulco