Hi again, as I'm getting myself familiarized with mp3Tag, it's happen to me to come to new doubts:
Did you know if there is anyway to ZERO PAD numbers in tags or filename to a fixed longitude. If it's possible how to do that for just a specified number (considering tag or filename have more than one), and letting the others untouched, for example:
234234 This my file 3.12 (43).mp3
234234 This my file A.12 (43).mp3
Zero padding to 3 only the number "12" at position 23 to get:
234234 This my file 3.012 (43).mp3
234234 This my file A.012 (43).mp3
Thanks in advance...
N.B: I've discovered that $num(x,y) can make the work but not as specifically as I need
It could probably be done using a regular expression and submatches. You'd replace one of the submatches with something like $num($2,3). Need to know a lot more about how the existing strings are constructed, though, in order to create the regex. Maybe you could give some examples.
Preview
From: 234234 English lesson 3.12 (43).mp3
To: 234234 English lesson 3.012 (43).mp3
It would be more convenient not to work on the filename directly, but to work with a tag-field which contains the proper value resp. use $num(x,y) when assembling the filename.
Please show us the format string, which assembles the filename.
From what tag-field does the number 12 come from?
If it is the track number, then use ... $num(%TRACK%,3) ... and all is fine.
Well ... anywhere at the beginning of your workflow you can split the given title string (e. g. "English lesson 3.12 (43)" into components e. g. "header chapter step" or so ...
... then assemble the parts as you need it to create the new filename ...
Uff, at last I get it, thanks a lot; Based on your: $regexp($regexp(%_filename%,'^(\d+)\s(.+?)\s(\d+).(\d+)\s(.+)$','$1 $2 $3.000$4 $5'),'^(\d+)\s(.+?)\s(\d+).0*(\d\d\d+)\s(.+)$','$1 $2 $3.$4 $5'), DetlevD, I find a way to do it, here it comes for use of anyone who may need it:
Just a last doubt: What is the difference between (.+?) and (.+) ? What's function had the ? here? In mp3Tag it says: ? repeated zero or one times only, but I can't see the functionality???
When writing a regular expression for Mp3tag, e. g. when splitting a text string into parts, basically I prefer lazy quantifiers wherever possible.
So it can happen, that there is a question mark used as a limiter for greediness, where the limitation may not strictly required.
Try out if this works ...
^(.+?)\.(\d+)\s(.+)$
Try out if that works ...
^(.+)\.(\d+)\s(.+)$
... then use the regular expression, which gives the best result.