trying to compare list of names from a text file, with a list of names from a csv file.
ive created a set of names from the text file using the following:
# receive text and create new list with open('text.txt') as f: lines = f.readlines() names =  # add first 5 characters from lines to list to get name for x in lines[9:1011]: names.append(x[0:5]) names.sort() # create set from list to eliminate duplicates unique_name = set(names) print(unique_name)
now id like to compare the set with a csv table with a name column and was wondering what the best way to do this is?
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.