Re: [Clip] Extracting text from a music .XML file.
- --- In firstname.lastname@example.org, 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
> 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.
To match all three (or more) lines starting with '001' try...
You wrote, however, that you want to convert it to...
x001 word-1a word-1b
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
- 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]