I have a txt file that I am trying to parse into variables....
Line 1 = 0154.45 +02 13.56 +03 64.35
Line 2 = +09 23.12 +10 8798
I have written a regular expression to parse out the first line, but how do I continue the regular expression onto the 2nd line to extract variables...ie $1 thru $5
Here is the input file:
B
A1 L+44941 C0747
*D
01+0100. 02+2014. 03+0111. 04+1820. 05+13.14 06+344.1 07+62.83 08+1017.
09+16.56 10+1811.
A1 L+44951 C5311
*
And my partial code
open(FH, "<$file");
@array = <FH>;
close FH;
open(OUT,'>','outfile.txt');
@array1 = @array
;
print OUT @array1;
close OUT;
open (FILE, "/test/outfile.txt");
while (<FILE>) {
print;
~ /^.*(
)/s;
$id = $1;
$year4 = $2;
$doy = $3 ;
$time = $4;
$speed = $5;
$ddir = $6;
$temp = $7;
$baro = $8;
$windgust = $9;
$gusttime = $10;