in reply to Re: Extract column of excel
in thread Extract column of excel
This is my code , but it does not read the entire csv file but reads from a particular cell of csv . I am working on one sheet only but the entries in column are about 1000. So can you suggest a way that the entire csv file is read at once#!/bin/perl -w use strict; #variables you can change to suit your needs my $column_separator = ","; my $column_number = "1"; $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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extract column of excel
by hdb (Monsignor) on Jun 04, 2013 at 11:48 UTC | |
by MynameisAchint (Novice) on Jun 05, 2013 at 05:17 UTC | |
by hdb (Monsignor) on Jun 05, 2013 at 05:27 UTC |