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

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

Expand Messages
  • flo.gehrke
    ... Alec, To match all three (or more) lines starting with 001 try... (^ d+)( x20.*)( R 1 x20.*)+ You wrote, however, that you want to convert it to... x001
    Message 1 of 47 , Nov 12, 2012
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
      >
      > I was hacking at this last night trying to come up with
      > non-looping (regex) solutions just because they are more fun.
      >
      > (1) I came up with a one-line regex that strips changes the input
      > to: (...)
      > (5) then a one-liner that will convert
      > 001 word-1a
      > 001 word-1b
      > 001 word-1c
      > 002 word2-a
      > 002 word2-b
      >
      > to
      > 001 word-1a word-1b
      > 001 word1c
      > 002 word2a word2b
      >
      > ie. ^!replace "(\d+)(\x20.*\R)\1" >> "$1 $2" rwsai
      >
      > what I couldn't figure out was how to do *ALL* the 001's in
      > one regex.

      Alec,

      To match all three (or more) lines starting with '001' try...

      (^\d+)(\x20.*)(\R\1\x20.*)+

      You wrote, however, that you want to convert it to...

      x001 word-1a word-1b
      x001 word1c
      x002 word2a word2b

      So you are converting two '001'-lines only leaving the third one unchanged. So, for this, you may try...

      ^!Replace "^(\d+\x20)(.+)\R\1(.+)$" >> "$1$2\x20$3" WARS

      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.