in reply to Re^3: regex help!
in thread regex help!
What I couldn't figure out was how to get it to go to the line after the data that I found. (I realized the line above the data was a unique line and that I could search for it directly). An example of the output is as follows:#!/usr/local/bin/perl -w print "Enter an output file to analyze: "; chomp ($phoenix_out= <STDIN>); open (OUTPUT_FILE, "$phoenix_out") or die "can't open $phoenix_out: $! +"; while (<OUTPUT_FILE>) { chomp; if (/0 EID: 93237 /){ print "$.\n"; next; print "anything?\n"; ($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l) = split; $ND243 = $i; print "The amount of Am243 is $ND243\n"; } #else { print "$. Problem!" }; }
The data extends longer across the page, but in the interest of width I didn't include all of it, it's just the same pattern repeated. Lastly, my attempt to understand your file:0 EID: 93237 93238 93239 94240 ND : 1.8833E-06 3.1143E-09 9.6338E-07 1.9309E-05 WT%: 8.2146E-03 1.3642E-05 4.2377E-03 8.5291E-02
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: regex help!
by GrandFather (Saint) on Sep 16, 2005 at 23:31 UTC |