Copy link to clipboard
Copied
I am trying to understand the RegEx syntax to accomplish a limited scope of rename/reorder operations for migration to a new MAM/storage system. I have thousands of files with file names resembling the following:
HS - 3_1_18_1pm_Jerry Garcia
and need to identify and reorder the date/time string from the existing M_DD_YY_Ttt format seen above to the new format of:
YYYY_MM_DD
and then possibly rearrange the different elements of the filename.
I have used Bridge extensively in the past for basic find/replace and sequencing jobs, but I have been unable to find a good primer on the RegEx syntax for advanced string substitution. Please advise.
Presuming that the year should be changed from 18 to 2018, one method would be to use Bridge's Batch Rename as follows:
Find:
(^.+ - )(\d+)(_)(\d+)(_)(\d+)(_.+)(_)(.+)
Replace:
$120$6_$2_$4$7_$9
Of course, it will not be that easy, as you probably also wish to pad out single D and M values to be DD and MM as well as the presumed 20 padding before the year to make YY into YYYY.
Copy link to clipboard
Copied
I'm not sure a regex is the way to go. Writing a script might work better since you are trying to parse the filename.
Copy link to clipboard
Copied
Please provide at least three full before and after examples including 1 and 2 digit date examples.
Copy link to clipboard
Copied
Presuming that the year should be changed from 18 to 2018, one method would be to use Bridge's Batch Rename as follows:
Find:
(^.+ - )(\d+)(_)(\d+)(_)(\d+)(_.+)(_)(.+)
Replace:
$120$6_$2_$4$7_$9
Of course, it will not be that easy, as you probably also wish to pad out single D and M values to be DD and MM as well as the presumed 20 padding before the year to make YY into YYYY.
Copy link to clipboard
Copied
Thanks you @Stephen_A_Marsh , that helps me greatly! I have also found RegEx Coach in the interim of these posts.