Re: [Clip] Extracting text from a music .XML file.
- --- In firstname.lastname@example.org, "Adrian Worsfold"<pluralist@...> wrote:
> For the avoidance of doubt, this is the clip that does work with
> the seegertomorrow.xml XML... I've just done it successfully and
Aaah, I can see your clip working now ;-)
I played around a bit more with that clip and tried to combine some ideas we've discussed so far.
So here is another proposal. It doesn't match all your needs but maybe you'll find some useful elements in here.
Please open seegertomorrow.xml in NT and try the following clip (needs NT 7.0 or 7.1):
^!Replace "'" >> "'" WAS
^!Replace "\R(?=</text>)" >> "" WARS
^!Find "(?s)^\x20*</credit>\R\K\x20*<credit page="1">.+</credit>" WRS
^!Replace "\x20(?=</text>)" >> "" WARS
^!Replace "<syllabic>(?:single|end)\X+?<text>[^<]+?\K(?=</text>)" >> "\x20" WARS
^!SetClipboard ^$GetDocListAll("^\x20*<lyric number="(\d+)\X+?<text>([^<]+?)</text>";$1|$2\r\n)$
^!IfEmpty ^%Text% Out
^!Replace "(?<=[,;.\x20])\x20?(?=[[:upper:]])" >> "\r\n" WARS
^!Save as "C:\Adrian's Documents\Music\^%FileName%.txt"
Watch long lines!
- Hello flo
Brilliant. Later on today I will alter the clip and instructions on my webpage. How you have managed to account for different line lengths in verses baffles me but thanks and I'll give appropriate thanks on the webpage when I re do it, including your further advice.
----- Received the following content -----
Time: 2012-11-16, 13:42:25
Subject: Re: [Clip] Extracting text from a music .XML file.
[Non-text portions of this message have been removed]