Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Extract column of excel

by vinoth.ree (Monsignor)
on Jun 04, 2013 at 05:33 UTC ( #1036895=note: print w/replies, xml ) Need Help??

in reply to Extract column of excel

Check this perl module Spreadsheet::ParseExcel::Simple

All is well

Replies are listed 'Best First'.
Re^2: Extract column of excel
by MynameisAchint (Novice) on Jun 04, 2013 at 05:46 UTC
    #!/bin/perl -w use strict; #variables you can change to suit your needs my $column_separator = ","; my $column_number = "8"; $column_number--; my $file="Working_On.csv"; open(FILE,"<","$file"); my @lines=<FILE>; close FILE; foreach my $line (@lines){ my @columns = split(/$column_separator/,"$line"); print $columns[$column_number],"\n"; }
    This code is working but the problem is that it does not take the entire column it truncates the column , if anyone can look why the code does not take the entire column . thanks

      While barely readable your code suggests that you are processing a CSV file, not an Excel file. This is quite a different question.

      Can you please specify in which way the column is truncated? Are you not getting all rows or are entries somehow garbled? Again, quite different approaches would be required.

        Yes I am working on csv file , the truncation is such that the entries are taken in the correct sequence but they are taken from somewhere in between not from the starting

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036895]
[Lady_Aleena]: That's what they mean, at least to me. 8)
[Discipulus]: in the first attempt i failed, with an not usable v-machine.. ;=)
[Discipulus]: but then discovered a registry trick to do before the physical2virtual migration
[Lady_Aleena]: Sounds like a headache.
[Discipulus]: a bit shaggy.. every atttempt is ~4hours to virtualize and 1-2hours to kick the big file to boot..
[Lady_Aleena]: Ouch...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-05-22 18:48 GMT
Find Nodes?
    Voting Booth?