okfn / messytables

Tools for parsing messy tabular data. This is now superseded by https://github.com/frictionlessdata/tabulator-py
http://messytables.readthedocs.io/
387 stars 110 forks source link

messytables doesn't recognize the right CSV columns #3

Closed gka closed 11 years ago

gka commented 12 years ago

messytable fails to recognize this tab-separated table. Here's what I tried:

from messytables import CSVRowSet
from urllib import urlopen
file = urlopen('./2012-Presidential-Campaign-Finance-Contributors.tsv')
rs = CSVRowSet('data', file)
sample = list(rs.sample)
len(sample[0]) # = 1
domoritz commented 11 years ago

Hi @gka. You have a TSV (tab separated value) file and will need to also pass delimiter='\t' to CSVRowSet.