field is freeform. i read about the restkey parameter, but that overprocesses it.
is there a built in python way, or do i have to write my own parser?
import csv
with open('example.txt', newline='', encoding='latin-1') as csvfile:
reader = csv.DictReader(csvfile, restkey= 'freeform')
for row in reader:
print(row)
example.txt:
string,number,freeform
abc,123,This format wasn't strictly defined, could be anything in this field, except a newline. All the way to the end of the line
Found a solution. https://stackoverflow.com/questions/24164249/parsing-csv-file-in-pandas-with-commas-in-last-column
Обсуждают сегодня