reverse file name of seconds minutes hours date

Advanced Renamer forum
#1 : 19/02-18 21:07
Jb
Jb
Posts: 2
did a search for this and didnt see an answer.

Ihave a radio scanner uniden 436HP that records audio of the channels it hears in whats called discovery mode.

when it records an audio clip it saves it as a file name of seconds,minute,hour, then the day month year example file name 14-11-05_16-02-2018

when i try to sort these it doesnt sort correctly because sorting by seconds is useless

if that file name was reversed to say 2018-02-16_05-11-14
then it would sort fine.

the use of sorting by file creation date attribute works for some, but some files are recovered and that creation date is not correct.

will this advanced renamer, batch reverse the file names so i can sort them correctly?

this is important to me because when i compile the files they get pieced together into one audio file.


19/02-18 21:07 - edited 19/02-18 21:11
#2 : 19/02-18 22:36
Mark
Mark
Posts: 175
Reply to #1:
Convert
14-11-05_16-02-2018 of the form ss-mm-hh_DD-MM-YYYY
to
2018-02-16_05-11-14 of the form YYYY-MM-DD_hh_mm_ss

There's a few ways to do this. Assuming the above is the total name, you can Rename using <Substr:> (see https://www.advancedrenamer.com/user_guide/compl ete_guide). If the name actually contains other characters/text etc, you should use the Replace method. You effectively re-order characters.

But that's clunky, this is sweet:

Replace method
Text to be replaced : (\d\d)-(\d\d)-(\d\d)_(\d\d)-(\d\d)-(\d\d\d\d)
Replace with: \6-\5-\4_\3-\2-\1
Occurrence: All
Case sensitive: un-ticked
Use regular expressions: ticked
Apply to: Name

See https://www.advancedrenamer.com/user_guide/regul ar_expresions
The "\d" is a metacharacter which represent any numeric value raging from 0 to 9.

You should be able to make out what is happening. Those brackets are pattern-matching, finding groups of numbers separated specifically by a - or _. Each group has a numerical number associated with it (a subpattern value) which is used in the pattern-based replace.

Re-arrange/edit to suit what you need. This will leave any other part of the Name untouched.

By the way, in AR method window (on the left), hit the ? button for direct help. Hit the </> for more info.

Mark




19/02-18 22:36 - edited 21/02-18 10:03
#3 : 25/02-18 07:03
Jb
Jb
Posts: 2
Reply to #2:
thank you, i got this figured out with your reply, i appreciate it alot!!


25/02-18 07:03
#4 : 25/02-18 22:43
Mark
Mark
Posts: 175
Reply to #3:
Great! And thanks for the feedback :)


25/02-18 22:43