madd has asked for the wisdom of the Perl Monks concerning the following question:
I need to get it as an array of arrays, i.e.C -2.3242E-003 1.32423 0.34243E+002 ..etc... -3.23134 H more numbers
I don't necessarily know the length of the array and they aren't necessarily the same. I've been trying to test on the first character of the line, but it seems to produce garbage. Any help appreciated.C -2.3242E-003 1.32423 0.34243E+002 ... -3.23134 H numbers
my $i=0; while <$input>{ if (/^[A-Z]){ $AA[$i][0] = $_; my $j=1; } else{ $AA[$i][$j] = $_; $j++; } $i++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read fortran list output
by moritz (Cardinal) on Jul 30, 2008 at 10:15 UTC | |
by pjotrik (Friar) on Jul 30, 2008 at 10:33 UTC | |
by moritz (Cardinal) on Jul 30, 2008 at 10:53 UTC | |
|
Re: Read fortran list output
by apl (Monsignor) on Jul 30, 2008 at 11:26 UTC | |
|
Re: Read fortran list output
by swampyankee (Parson) on Jul 30, 2008 at 11:15 UTC |