Hello,
I've used the excellent grep search/replace feature in TextWrangler fairly extensively, but don't yet understand how to use capture groups that can be treated as a variable, so as to rearrange the components inside a filename. If someone could assist by showing how to set up the example I'm including, I'll be able to extrapolate this to additional cases.
Here I simply need to exchange the tape number (57-04), with the segment number (seg1). Once I understand how to do us, I will use "A Better Finder Renamer" in OS X to regularize several thousand filenames in a complex audio archive. Regular expression support in this app is based on the RegexKitLite framework, which uses the regular expression engine from the ICU library in OS X.
Sample filename: 1962-10-22-CH_seg1_57-04.aif
Desired result: 1962-10-22-CH_57-04_seg1.aif
Variations: the numeric component at the end of the filename (57-04), ranges from 1-00 to 999-10.
Note: I tried to post this question on stackoverflow this evening, but got slammed instead of assistance!
Thanks in advance!
—————
Christopher Campbell