A quick couple things. The first reason I didn't post code, or output, is because I couldn't figure out how to use the tags for presenting it and I felt like an idiot. Like I said I'm new, so thanks for bearing with me. In any event, here is what I had done:
#!/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!" };
}
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:
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
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:
match according to NP, then white space, then U, then white space, then Pu ending ... case insensitive. Last if there is no more data? Also, next loop if there is a match? Is this what moves you to the next line down? Break up the current data into substrings, I can figure out what the nomenclature means although I don't know it offhand, I have books I can read it from. Print off the results.
Again, thank you for the help, sorry for sucking at my posts early on, and any clarifications you would like to provide would be much appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.