in reply to Accessing cells in CSV files
my @array = <FILE>; stores the lines of your file in the array. They still need to be split into columns:
use strict; use warnings; use Data::Dumper; my @array = <DATA>; # now contains the rows print Dumper(\@array); $array[$_] = [ split /\s+/, $array[$_] ] for 0..$#array; # split lines + into columns print Dumper(\@array); print $array[0][0]; # does not look like CSV... __DATA__ organism O2_REQUIREMENT Domain Classification a.acidocaldarius Aerobe BACTERIA FIRMICUTES a.actinomycetemcomitans Facultative BACTERIA PROTEO
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Accessing cells in CSV files
by space_monk (Chaplain) on May 13, 2013 at 15:46 UTC | |
|
Re^2: Accessing cells in CSV files
by newbie1991 (Acolyte) on May 13, 2013 at 15:15 UTC |