in reply to Re: Regular Expression ?
in thread Regular Expression ?
open(FH, "<$file"); @array = <FH>; close FH; open(OUT,'>','outfile.txt'); @array1 = @array[3..$#array-4]; print OUT @array1; close OUT; open (FILE, "/test/outfile.txt"); while (<FILE>) { print; ~ /^.*([0-9][0-9][0-9])..*([0-9][0-9][0-9][0-9])..*([0-9][0-9][0-9] +)..*([0-9][0-9][0-9][0-9])..*([0-9][0-9][.][0-9][0-9]) .*([0-9][0-9] +[0-9][.][0-9]) .*([0-9][0-9][.][0-9]).*([0-9][0-9][0-9][0-9])/s; $id = $1; $year4 = $2; $doy = $3 ; $time = $4; $speed = $5; $ddir = $6; $temp = $7; $baro = $8; $windgust = $9; $gusttime = $10;
I appreciate your patience, as this is my first attempt at asking for help on this forum.
My input file follows: 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 *
|
|---|