# for each line, get the part no., compare to contents of # the notes field on every other line, if it is in the # notes field, delete the line otherwise leave and move on # to the next line. Finally delete all dupes and merge the # list with the approved.txt open(COMPARED,"+<$filename04") || die "Can't open file $filename04"; # open destination text file @comparedall = ; $numoflines03 = @comparedall; for ($a = 0; $a < $numoflines03; $a++) { $line03 = @comparedall[$a]; @comparedline = split (/\"/, $line03); $part = @comparedline[1]; $notes = @comparedline[9]; @notes = split (/\,/, $notes); $numofnotes = @notes; for ($b = 0; $b <= $numofnotes; $b++) { $notescontent = @notes[$b]; print $notescontent, "\n"; if ($part eq $notescontent) { print "hello"; } } }