Let me write a hypothetical question for you that may or may not be what you were trying to ask:
Most wise monks, I am very new to Perl but have been given a large data file to read that was generated by an old Fortran program. The data are in pairs of lines with a header line and a data line like this:
000 NP U Pu 001 1.270000 000001 3.141000 002 Lev N Pu 003 0.13 000001 3.277118 004 NP U Pu 005 1.000220 000002 3.098761 006 Yac S Yb 007 10.33000 000001 90000000
I need to extract the NP U P lines of data. I have worked out how to read the file. But I can't figure out how to find the data. My code so far looks like this:
open I,"data.dat"; for($I=0;$I<1000;++$I) { $l1=<I>; chop $L1; $L2=<I>; chop $L2; #find the data here printf ("%d, %d, %d\n", $N1, $N2, $n3); }
Can someone help me with the code I need to replace the comment please?
In reply to Re: regex help!
by GrandFather
in thread regex help!
by igotlongestname
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |