Parsing Text
Hi,
I've got a problem that to my mind should be kind simply to fix but after hours of searching can't find anything.
Basically, my patch reads ID3 Tag data from an XML file, and splits it into individual lines that read like:
The Beatles
Revolver
Taxman</>
etc...
Is there anyway to get rid of the & parts. I've tried to do this with [sprintf] and [regexp] but am having no luck as MaxMSP reads it as one word.
Failing that is there a way it can be converted into numbers, something like unicode. As it's use eventually will be to query a database.
Any tips would be great, cheers.
regexp should do the trick:
Not sure if it is of interest to you, but Jeremy Bernstein made a nice object for reading id3 tags, metatag:
-Ben
Cheers Ben, that's exactly what I wanted, just hadn't got round to learning the regexp syntax.
Will also check out Jeremy Bernstein's object, looks very relevant to my project.
Yeah, its a bit of a beast.
As far as learning the regexp syntax, here are a few useful ref links:
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
http://www.regular-expressions.info/reference.html
There are some nifty tutorials out there too. I remember reading through this one and finding it useful:
-Ben
there's also tap.xml.sax from Electrotap's Tap.Tools objects, which saves having to learn any regexp and also maintains structure...