Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a csv file and i am seprating out its column , the function defined for it is
sub column_segregation_Spec_values { my ($file,$col) = @_; use Text::CSV; my @array_A2 = (); open my $io,'<',$file or die "$!"; my $csv = Text::CSV->new ({ binary => 1 }); while (my $row = $csv->getline($io)) { push @array_A2, $row->[$col]; } close $io; return (@array_A2); }
Now this function will return seperated columns as array . Now since the number of columns are unknown , I wish to put them in double dimension array , as one column will occupy one row and so on , how can i do it
please don't suggest to use split , because I can't because there can be a user given comma . thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: taking csv and seprating unknown number of columns
by Tux (Canon) on Jul 23, 2013 at 13:42 UTC | |
|
Re: taking csv and seprating unknown number of columns
by hdb (Monsignor) on Jul 23, 2013 at 14:26 UTC | |
|
Re: taking csv and seprating unknown number of columns
by Anonymous Monk on Jul 23, 2013 at 13:41 UTC | |
|
Re: taking csv and seprating unknown number of columns
by Laurent_R (Canon) on Jul 23, 2013 at 22:26 UTC | |
by Anonymous Monk on Jul 24, 2013 at 02:40 UTC | |
by Laurent_R (Canon) on Jul 24, 2013 at 17:52 UTC |