in reply to Re^2: Extract column of excel
in thread Extract column of excel
Your code works fine! I have only added a chomp but that does not really make a difference...
#!/bin/perl -w use strict; #variables you can change to suit your needs my $column_separator = ","; my $column_number = "2"; $column_number--; my @lines=<DATA>; foreach my $line (@lines){ chomp($line); my @columns = split(/$column_separator/,"$line"); print $columns[$column_number],"\n"; } __DATA__ 1,2,3,4 A,B,C,D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Extract column of excel
by MynameisAchint (Novice) on Jun 05, 2013 at 05:17 UTC | |
by hdb (Monsignor) on Jun 05, 2013 at 05:27 UTC |