Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Extracting text from a music .XML file.

Expand Messages
  • flo.gehrke
    ... Hi Adrian, 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
    Message 1 of 47 , Nov 15, 2012
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "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
      > instantly.

      Hi Adrian,

      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):


      ^!SetScreenUpdate Off
      ^!Replace "'" >> "'" WAS
      ^!Replace "\R(?=</text>)" >> "" WARS
      ^!Find "(?s)^\x20*</credit>\R\K\x20*<credit page="1">.+</credit>" WRS
      ^!Set %Credits%=^$GetSelection$
      ^!Set %Credits%=^$StrReplace("<[^>]+>";"";^%Credits%;AR)$
      ^!Set %Credits%=^$StrReplace("^\x20+";"";^%Credits%;AR)$
      ^!Set %Credits%=^$StrReplace("^\R";"";^%Credits%;AR)$
      ^!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)$
      ^!Select All
      ^!Paste
      ^!Set %Nr%=1

      :Loop
      ^!Set %Text%=^$GetDocListAll("^^%Nr%\|(.+)";"$1")$
      ^!IfEmpty ^%Text% Out
      ^!Append %All%=^%Text%^P^P
      ^!Inc %Nr%
      ^!Goto Loop

      :Out
      ^!Select All
      ^!InsertText ^%All%
      ^!Replace "(?<=[,;.\x20])\x20?(?=[[:upper:]])" >> "\r\n" WARS
      ^!Jump Doc_Start
      ^!InsertText ^%Credits%^P
      ^!Jump Doc_Start
      ^!Set %FileName%=^$GetLine$
      ^!Save as "C:\Adrian's Documents\Music\^%FileName%.txt"
      ^!ClearVariables

      Watch long lines!

      Regards,
      Flo
    • Adrian Worsfold
      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
      Message 47 of 47 , Nov 16, 2012
      • 0 Attachment
        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.




        Adrian Worsfold

        http://www.pluralist.co.uk
        http://pluralistspeaks.blogspot.com
        pluralist@...
        16-11-2012
        ----- Received the following content -----
        From: flo.gehrke
        Receiver: ntb-clips
        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]
      Your message has been successfully submitted and would be delivered to recipients shortly.