Sameet has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Spreadsheet::ParseExcel; my $xls = Spreadsheet::ParseExcel->new(); my $xls_book = $xls->Parse( 'chrocordinates.xls' ); my $xls_worksheet = $xls_book->{Worksheet}[2]; my @contigs = map { $xls_worksheet->Cell( $_ , 0 )->Value} 1 .. 674; my @coordinates = map {$xls_worksheet->Cell($_, 1)->Value} 1 .. 674; #print "@contigs\n"; print "@coordinates\n"; # When print there are 674 entires my $new_contig; my $new_coordinate; do{ foreach my $contig(@contigs){ $new_coordinate = shift (@coordinates); $new_contig = shift (@contigs); print "$new_coordinate => (chromosome => \'\', contig +=> $new_contig)\n"; } } # prints only 300+ odd entires
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing Excel Columns into arrays
by jdporter (Paladin) on May 02, 2004 at 19:36 UTC | |
by Sameet (Beadle) on May 03, 2004 at 07:21 UTC |