"be consistent" | |
PerlMonks |
How to read each line of a file into a nested arrayby opolat (Novice) |
on Jun 18, 2002 at 09:37 UTC ( [id://175316]=perlquestion: print w/replies, xml ) | Need Help?? |
opolat has asked for the wisdom of the Perl Monks concerning the following question:
I have a partially sorted NASTRAN output file (NASTRAN is a finete element analysis software).
I would like to read each line of the NASTRAN file into an array first. Each line contains 9 numbers
seperated by white space. After reading each line I would like to put the first number of each line
into a new nested array as a column and put the line which this number belongs to
as a string into same nested array as the second column. Example: 1 2 3 4 5 10 20 30 40 50 200 100 300 2 1 new nested array will be array(0,0) = 1 array(0,1) = '1 2 3 4 5' array(1,0) = 10 array(1,1) = '10 20 30 40 50' array(2,0) = 200 array(2,1) = '200 100 300 2 1' Is this possible, can anybody help me???
Back to
Seekers of Perl Wisdom
|
|