ioana007 has asked for the wisdom of the Perl Monks concerning the following question:
I am reading all the files from an ARGV listline_number var1 var2 .... varN
I want to create for each variable an output file that would contain something like:for my $file (@files) { while (<IN>) $line_number= $list[0]; push @($var1{$i}), $list[1]; etc... } close IN; }
What is the way to write in the same line of the output filefor my $j (0...Nlines-1){ open(OUT, ">", "./var1.dat") print OUT "$line_number \t $var1{file1}[$i] \t $var1{file2}[$i] \t ... + $var1{fileN}[$i]\n" } close OUT;
Is there a way to open a $NEWLINE variable and keep appending
to it values from each of the input file and, after reading
from all the input files, closing the line
and then writing the line in the output file?
Thank you,
Ioana
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: append to a line arrays read from N different input files
by dogz007 (Scribe) on Aug 16, 2007 at 23:51 UTC | |
|
Re: append to a line arrays read from N different input files
by graff (Chancellor) on Aug 17, 2007 at 02:10 UTC |