Hi folks,
I'm trying to organize a fairly large library who's filename structure is constant but badly constructed. When the songs were ripped from source a leading dash (-) between the title and track number was omitted, but a space-dash-space ( - ) was added after the track number. Thus:
The Who - Won't Get Fooled Again 005 - .mp3
instead of The Who - Won't Get Fooled Again - 005.mp3
What I'm trying to accomplish is to extract the track number from the filename and move it into the TRACK # field, leaving the actual filename to read: The Who - Won't Get Fooled Again.mp3
As always ... Mp3tag provides several ways to reach the goal ...
here is one way ... using the converter "Tag - Tag" ...
Step 1:
Convert | Tag - Tag | ALT+5
Select format string
Field: TRACK
Format string: $regexp(%_filename%,'^(.+?)\s0*(\d+)\s.+?$','$2')
Preview: 5
Step 2:
Convert | Tag - Tag | ALT+5
Select format string
Field: _FILENAME
Format string: $regexp(%_filename%,'^(.+?)\s0*(\d+)\s.+?$','$1')
Preview: The Who - Won't Get Fooled Again
... or ...
Step 1:
Convert | Tag - Tag | ALT+5
Select format string
Field: TRACK
Format string: $num($cutLeft($trimRight(%_filename%,' -'),$strrchr($trimRight(%_filename%,' -'),'')),1)
... or ...
Format string: $num($reverse($num($trimLeft($reverse(%_filename%),' -'),1)),1)
Preview: 5
Step 2:
Convert | Tag - Tag | ALT+5
Select format string
Field: _FILENAME
Format string: $trimRight(%_filename%,' -0123456789')