in reply to Parsing lines containing extra carriage returns
.... this works only if you're garanteed to have 3 columns.my $file; { local $/ = undef; # learned something ;} $file = <>; #or <FILE> } $file =~ tr/\r//d; #remove carriages my @items = split /[\t\n]/, $file; #one array of items; my $rowsize = 3; my @AoA; while( @items >= $rowsize ){ push @AoA, [splice @items, 0, $rowsize]; }
Hope this helps,
Jeroen
"We are not alone"(FZ)
|
|---|