Gettin rid of specified prefixes...

Hello again!

I would like Mp3tag to swap prefixes such as: the, a, dj when using Tag to Filename function, so that i.e.
DJ Quik -> Quik, DJ

In foobar2000 there is a nice scripting function for this $swapprefix(X,prefix1,prefix2,…)

I also wonder if it would make sense to add some tags to determine a proper sort order for mobile devices/computer software.
I use ID3v2 tags and it contains some specified fields to that. I just don't know if it's worth spending time on as foobar2000 can make it perfectly without them, my iPod 5G also (except "dj" prefix; iPod doesn't omit it when sorting)

What is your opinion on that matter?

Lookin forward to hearing from you :slight_smile:

Hello, is anybody there? :rolleyes:

a) I am. But whether I can help you?
:sunglasses: as many player have their own will in interpreting leading articles I think it wiser to simply KNOW what kind of "prefix" has to be considered or not.
Your way of classifying "DJ" as a sort of name prefix is a rather individual way that is hardly applicable for the rest of the world.

I would advise you to fill the tag %artistsortorder% with the format field action to get your specific sorting wishes across to Itunes.
I do not know what other players will make out of this and wheter the results will be surprising (this is not an invitation to discuss the pros and cons of various players in respect to their sorting. This only to make a point that should be considered).

Which fields are compatible with iTunes? From what I've noticed iTunes (and iPod therefore) doesn't use any tag fields to determine sort order.

Coming to Format Field action. How it should look like? As i said there is no $swapprefix() function in Mp3tag.

there are the tags albumsortorder, bandsortorder, artistsortorder which have to filled with the significant words - in your example this would be Quik of DJ Quik for artistsortorder.

Getting these fields filled you create an action of the type "Format field", select artistsortorder as field and %artist% as formatstring. This will copy the content of artist into the field artistsortorder.
(Perhaps right now you should add a colum in the list of MP3Tag which shows the field artistsortorder).
Now you are free to manipulate the contents of the newly won field artistsortorder anyway you like.
In your case this would mean to delete all "DJ " from artistsortorder. You do this again with a simple replace action. You may add this action together with the previous format field action to an action group that does the copying and deleting in one go.
Probably there are some MP3tag lovers out there that know a sophisticated regular expression but I think doing it step by step is better for the beginning.

As soon as iTunes has reread the mp3s (a problem of its own) you should see and feel the new sorting order.

Thank you for your reply ohrenkino

As far as sorting is concerned I don't care what happens to prefix but as far as Tag - Filename conversion is concerned I want prefix in the end of the field after comma (like I said: Quik, DJ; The Roots -> Roots, The).

Action Replace does not fit me. It's fair not enough sophisticated :slight_smile: It will remove specified characters from ALL OVER the field and what I'm trying to reach is remove them ONLY from the beginning.

Anyway, thank you for your concern.

I've just tested ID3v2 sort frames compatibility with iTunes and it seems he supports all of them (hope my iPod 5G either):

ARTISTSORTORDER (TSOP)
ALBUMSORTORDER (TSOA)
BANDSORTORDER (TSO2)
COMPOSERSORTORDER (TSOC)
TITLESORTORDER (TSOT)

I'm sure $regexp() (or whatever) I am looking for is not so complicated (I try to figure it out myself). Come on :slight_smile:

I think that the sophistication of the replace action is linear to the sophistication of the search string.
If you, e.g. enter a delimiter for the beginning of the field "^" then only that part will be replaced and not everything ...
Anyway, I am sure that you will figure it out yourself as you have announced that. That's good.

Just a word about tempering with artists' names: if you exchange mp3s with others it causes an awful lot of extra work to adapt the tracks to any individual naming conventions. In the end I settled with my friends to keep all names as the artist calls himself, letter by letter.
To my experience file names are void and serve the only purpose of avoiding to overwrite existing files. All player libraries live with the internal tags but not where a file is stored or how it is named.
For me, file names are only a way of storing some inside information if the tags should become corrupt or a recoding is necessary. Without that convenience they could be called phiddsleepootsly or the like, the handling by the players would not differ.

So I doubt that the effort you try to invest will actually facilitate your track handling. But you will have your own experiences and good reasons to work the way you do.

On the other hand, this single effort will keep my folder structure better organized (there is no doubt I have to use Windows Explorer sometimes) and may pay off some day. Plus, by looking for the answer, I might learn something helpful, won't I?

$regexp(%fieldname%,^(the|a|dj)\s(.*),$2',' $1,1)

Pretty easy, in fact.