Can someone please let me know how to achieve the below through Perl.
I have a CVS file with values like below.
i/p:
Symbol,A,B,C,D,E,F
66,.8500,.8500,1.1600,1.1600
O/P:
[['Symbol','A','B','C','D','E','F' ], ['66','.8500','.8500','1.1600','1.1600']];
and assign the same to a variable.
How can i able to achieve this through Perl script.
$sts = open( CSV, "< File.csv" );
while (<CSV>) {
$csv = $_;
chomp($csv);
@csv_rcd = split( ',', $csv );
foreach $cell (@csv_rcd) {
push @rowdata, $cell;
}
push @$somedata, @rowdata;
}
But the above code didn't produce the desired o/p.