chen li wrote:
> Dear all,
Hello,
> I need to read a data file containing 96 records/lines
> and each record/line contains several columns
> separated by tab. I would like to extract the first
> column from each record only and put them into a 12x8
> array. Here is the script I use to do the job but it
> seems I have some problems with the loop to build a
> 12x8 array(I just get a one-dimenstion array only).
> Any comments?
Perhaps something like this:
my @data;
while ( <FH> ) {
$.-- and next if /CPM/ or !/\S/;
push @{ $data[ ( $. - 1 ) % 8 ] }, /^([^\t]+)/;
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>