,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Dobbin Last Name: David L. Address: david@adamsonanddobbin.com City: PO Box 1326407 Pido Road State: Peterborough ZIP Code: ON Country: K9J 7H5 First Name: Dobbin Last Name: David L. E-mail: david@adamsonanddobbin.com Address: PO Box 1326407 Pido Road City: Peterborough State: ON ZIP Code: K9J 7H5",,,,,,Home,743 7790,Other,742 4524,Work,745 5751,,,,,,,,,,,Adamson And Dobbin Ltd. Mechanical Contractors,,General Manager,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Chapleau Last Name: Kathy, Ken Address: 666 FrankFirst Name: Chapleau Last Name: Kathy, Ken City: 666 Frank ",,,,,,Home,876-9863,,,,,,,,,,,,,,,Admiralty Hall,,Accountant,,,,,,,,,,, #### if ($notesField =~ /First Name:.*?(?=Last)/) { print "MATCHED!"; } #### use strict; use warnings; use Text::CSV; my $csv = Text::CSV->new ({ sep_char => ',', binary => 1, auto_diag => 1, allow_loose_quotes => 1 }); my $file = $ARGV[0] or die "Need to load a file from stdin"; open (my $data, '<', $file) or die "Couldn't load file '$file'\n"; while(my $row = $csv->getline($data)) { my @fields = @{$row}; my $notesField = $fields[25]; if (defined $notesField) { if ($notesField =~ /First Name:.*?(?=Last)/) { print "MATCHED!"; } } else { print"No Notes Field \n\n"; } } if (not $csv->eof) { $csv->error_diag(); } close $data;