Hi
I've indexed my MP3 with Properties like Title and Artist.
The filename shows like "dummy - Title.mp3". The title ist the last part of the filename after the last hyphen.
But sometimes the field title contains only a part from the "title" of the file name.
Can i Filter this files? i need some ideas.
best regards
Martin
Filter Property against a part of the filename
Re: Filter Property against a part of the filename
Please try matching the title in the filename with regex:
regex:" - (.*)\.mp3$" addcolumn:regmatch1
This will show a Regular Expression Match 1 column
Values in this column will show the title from the filename.
To find files where the title in the filename doesn't match the title property, include the following in your search:
regex:" - (.*)\.mp3$" addcolumn:regmatch1 title:!=regmatch1:
You can use the multi-file renamer to rename your files with the title property.
The title property can be referenced with $title:
regex:" - (.*)\.mp3$" addcolumn:regmatch1
This will show a Regular Expression Match 1 column
Values in this column will show the title from the filename.
To find files where the title in the filename doesn't match the title property, include the following in your search:
regex:" - (.*)\.mp3$" addcolumn:regmatch1 title:!=regmatch1:
You can use the multi-file renamer to rename your files with the title property.
The title property can be referenced with $title:
Re: Filter Property against a part of the filename
Good idea with NOT Match the column
But the RegEx is not matching after the last hyphen.
Please have a look at the attachment.
It matches the last hyphen of the path (Fullpath).
Even if i change it to
regex:name:"- (.*)\.mp3$" addcolumn:regmatch1
It matches after the first hyphen.
I have tried with lookbehind but with no luck.
But the RegEx is not matching after the last hyphen.
Please have a look at the attachment.
It matches the last hyphen of the path (Fullpath).
Even if i change it to
regex:name:"- (.*)\.mp3$" addcolumn:regmatch1
It matches after the first hyphen.
I have tried with lookbehind but with no luck.
- Attachments
-
- regex.jpg (593.37 KiB) Viewed 1164 times
Re: Filter Property against a part of the filename
That is because the pattern you specified -- "dummy - Title.mp3" -- contains one hyphen and your filenames contain two.
Wrong pattern, wrong matching ...
This should do. It matches whatever comes after the last hyphen (+ space) and before the .mp3 file extension
Wrong pattern, wrong matching ...
This should do. It matches whatever comes after the last hyphen (+ space) and before the .mp3 file extension
Code: Select all
regex:"^.* - (.+)\.mp3$
Re: Filter Property against a part of the filename
very nice.
I use it with the ending Quotionmarks.
As you pointed out that multiple hyphens can occur, I got the idea to separate all parts of the filename.
So the regex would have to recognize if it starts with a digit, then other parts could follow like Artist and Title. But always separated with the hyphen.
So there is
Artist - Title.mp3
Track(1-3digit) - Title.mp3
Track(1-3digit) - Artist - Title.mp3
But I don't manage to formulate these three matches and put them in their own columns if necessary.
I have a hard time with regex because I don't understand it properly.
Already alone to show in Everything only the file name, so without extension, in an own column, I do not manage. (even without regex)
best regards
Martin
I use it with the ending Quotionmarks.
As you pointed out that multiple hyphens can occur, I got the idea to separate all parts of the filename.
So the regex would have to recognize if it starts with a digit, then other parts could follow like Artist and Title. But always separated with the hyphen.
So there is
Artist - Title.mp3
Track(1-3digit) - Title.mp3
Track(1-3digit) - Artist - Title.mp3
But I don't manage to formulate these three matches and put them in their own columns if necessary.
I have a hard time with regex because I don't understand it properly.
Already alone to show in Everything only the file name, so without extension, in an own column, I do not manage. (even without regex)
best regards
Martin
Re: Filter Property against a part of the filename
Good! That is how it was meant.
Add column stem: (right-click result list header, select Add Columns, search for stem )
The following could (and should!) be optimized, but it is 30 degrees over here and both my braincells are already boiling, so this has to do for now:
Code: Select all
regex:"^(\d{1,3}) - (.+?) - (.+)\.[^.]+$" | regex:"^(\d{1,3}) - ()(.+)\.[^.]*$" | regex:"^()([^0-9].+?) - (.+)\.[^.]*$" addcolumn:regmatch1;regmatch2;regmatch3
match2 = artist
match3 = title
(there is no solution for tracks like "01 - Shine On You Crazy Diamond (Parts I - V).flac" or artists like "Sophie Ellis - Baxter" )
Don't know what your ultimate goal is, but you could also add columns for tracknr, artist and title based on the mp3 tags instead of parsing the filename for that. (Add columns, select Audio in the left pane to see available properties)