in reply to Extracting Data from a second line

Read two lines at a time and concatenate them. Use /s on the regex to allow '.' to match the newline.

#! perl -slw use strict; m[red line.*location (\S+) (\S+)\n]s and print "($1, $2)" while $_ = <DATA> . <DATA>; __DATA__ A red line is found at location 2.5 4.5 A Blue line is found at location 2.6 4.5 A red line is found at location 2.67 4.56 The red arc is found at location 2.5 4.5

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Extracting Data from a second line
by RCP (Acolyte) on Feb 17, 2006 at 13:07 UTC
    Thanks to ALL of those that replied, these insights were exactly what I needed to get the information I wanted. RCP