
Laurent_R
Veteran
/ Moderator
Jul 24, 2013, 11:23 PM
Post #2 of 2
(2526 views)
|
Re: [genetist] how to compare rows in csv file with perl
[In reply to]
|
Can't Post
|
|
The next thing you need to do is to split your $line into an array or into individual variables:
while( my $line = <$info>) { my @fields = split / /, $line; print $line; last if $. == 19; } Now, the @fields array containts the individual fields, you can compare $fields[0] with $fields[7] or whatever you need. Or this;
while( my $line = <$info>) { my ($a, $b, $c, $d, $e, $f, ...) = split / /, $line; print $line; last if $. == 19; } Same thing, you can now compare $a with $f, or whatever you need.
|