# \[Script\] - Update with a sorted version of a field containing comma-separated values

**URL:** https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314
**Category:** General Discussion
**Created:** [January 4, 2013, 3:01pm UTC](https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314 "2013-01-04T15:01:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![donbuz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@donbuz](https://community.mp3tag.de/u/donbuz)
#### Post date: [January 4, 2013, 3:01pm UTC](https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314/1 "2013-01-04T15:01:44Z")

</div>

Good Day Everyone,

I am trying to figure out whether or not it is possible to update a field (Genre for that matter) that contains a list of comma-separated values (for example 'Tech House, Jazz, Ambient') with a sorted version of the very same field (with the previous example leading to 'Ambient, Jazz, Tech House') ?

Thank you for any help you may provide me with,

Don

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [January 4, 2013, 3:32pm UTC](https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314/2 "2013-01-04T15:32:51Z")

</div>

Currently there is no chance to do so in Mp3tag.

DD.20130104.1728.CET

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 4, 2013, 3:37pm UTC](https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314/3 "2013-01-04T15:37:31Z")

</div>

There is no sorting function on fields for scripting in MP3tag.

You would have to export the field contents to an external text-file, let loose an external sorting application and then re-import the updated text-file.  
Please not that for V1 tags only the pre-defined genres are valid (and are encoded with an id).

Other applications like WMP may display multiple values for some fields (composer, artist) but WMP uses the semi-colon plus blank to separate entries - the entries then appear as single composers (in alphabetical order created by WMP, though, so there is no need to sort in the fields).  
iTunes does nothing like that.

If you are lucky enough to find a player that can cope with these entries, please also note that sometimes an alphabetically sorted order does not reflect other requirements as some terms may represent the major entry (e.g. jazz) and the next one (e.g. free) the minor classification.

---

<div class="post-metadata">

### Author: ![donbuz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@donbuz](https://community.mp3tag.de/u/donbuz)
#### Post date: [January 8, 2013, 8:25pm UTC](https://community.mp3tag.de/t/script-update-with-a-sorted-version-of-a-field-containing-comma-separated-values/14314/4 "2013-01-08T20:25:27Z")

</div>

Thank you both for your precious answers,

Don
