thanks bigearsbilly and muha for your help i've been able to generate happily input files w/o much efforts.
Now i was trying to modify the script to make an inverse operation, since N input files give me N output, and i wish to have all the results into a text file for importing in excel, what i want to do is this:
look inside N files one by one, find where is the tag "vals"
after the tag there will be 8 values, i should collect only the 3rd the 5th and 7th and put them into a text file separated by spaces.
Each file should be on a line.
a sample outup file is this kind
mcnp 5 07/06/07 02:03:49 101 10000000 150547532
c cell cards
tally 18 2 0
impulsi in un detector
3.00000E-02 8.34230E-01 8.35770E-01
1.15955E-01 0.0009 1.10371E-01 0.0009 2.83826E-02 0.0019 2.54708E-01 0.0005
tfc 1 1 1 1 1 1 1 4 1
10000000 2.54708E-01 5.40931E-04 4.21937E+05
where the numbers i am interested in are in bold.
I was thinking in modifiying the script like this:
@ARGV = ($data_file);
@coords = <>; # slurp coordinates
warn "Is '$data_file' a proper coordinate file? It contains non-numerics\n"
if grep vals /[a-z]/i, @coords;
but i am pretty unsure is correct..
beside that i have no clue how to tell it to open multiple files..
if someone can help i will be very thankful!