in reply to Variable/multiple matches using grep
CSV file is comma delemited file , you could loop through the file and do what you want , for example :
# open CSV file open(FH,"myfile.csv") or die $!; # Loop through file content while (my $line = <FH>) { # split each line so ( $data[0] == first col , $data[1] == seconds + col ... so on ) my @data = split(/,/$line); # now you can test if something matched or not if ( ... ) { # Do Something here # if you want to end the loop after the first match , we just +use last : last; } } # close File handle close(FH);
HTH
|
|---|