I have a CSV file with about 2000 records.
Each record has a string, and a category to it:
This is the firs
A simple loop would suffice:
lines = [] with open('test.txt', 'r') as f: for line in f.readlines(): l,name = line.strip().split(',') lines.append((l,name)) print lines