complex pattern

Advanced Renamer forum
#1 : 20/02-16 13:21
Henri
Henri
Posts: 2
Hi @

im new to this program and want to do the following.....

1) old pattern aaaaa_ddmmyy_hhmm_bbbb.mp3
2) new pattern should be aaaaa_yymmdd_hhmm_bbbb.mp3

aaaa is of different length and always delmited by "_" as also the pattern to be changed.

dd is to be repalced by yy and yy by dd

How do i do this
Many thanks for any advise
Henri


20/02-16 13:21
#2 : 20/02-16 14:58
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #1:
You should use the Replace method and configure it like this:
Text to be replaced: (.+)_(..)(..)(..)_(.+)
Replace with: \1_\4\3\2_\5
Use regular expressions: Checked
Apply to: Name

The solution might require a little explanation. It uses regular expressions for matching patterns in the filename. The ( and ) are used to mark a group. A group gets a number, which are used in the replace with text box. Notice how the \4\3\2 reverses the order of the pattern. The dot . means any character, while + means that the previous character (in this case any character) is repeated one to any time.


20/02-16 14:58
#3 : 20/02-16 19:31
Henri
Henri
Posts: 2
Reply to #2:
Many thanks it worked perfectly on 857 files
Henri



20/02-16 19:31