On 4/3/06, timmorris wrote: > > OK, I'm struggling. > > It's been almost twenty years since I've used grep on unix. > > 1. Are there any primers on how to use the expressions to do some > clever string searching. > > 2. How do you then use parametric options to perform the editing you > want. > > First off a primer would be great. Just to get me started what > expressions would you use to create an action that takes the artist > names and adds an artistsort tag in the following manner > > K.T. Tunstall -> Tunstall, K.T. > James Blunt -> Blunt, James > > Tim
Hi Tim, 1: there are a massive number of regular expression primers out there. Googling for "regular expression primer" will turn up more sites than you can shake an expression at. 2: There's a couple of ways of doing this, depending on how much you want to play with it.Without a regular expression: Create a 'Format Value' action in MP3Tag that sets ArtistSort to a calculated value, using the built-in scripting functions in MP3Tag. Take a look at http://www.mp3tag.de/en/help/main_scripting.html >From this, you should be able to use $strchr(x,y) with $left(x,n) to get the first and second words in %ARTIST%, and put it all together to get a new value for %ARTISTSORT%. A more elegant solution would be to use the 'replace with regular expression', but again, you'll have to play with it a bit. Basically, create a two-part action: 1. Set ArtistSort equal to Artist 2. 'replace with regular expression': Field: %ARTISTSORT% Regular Expression: ^(.+)\s(.+)$ Replace with: $2, $1 Cheers Geoff _______________________________________________ Discuss mailing list [email protected] http://lists.slimdevices.com/lists/listinfo/discuss
