You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm currently using this lib to generate pretty ascii tables.
I get my data from a csv file where the delimiter is set to ;.
So I think thwe from_csv should take an optional delimiter arg, so it does not
need to guess the dialect. I looked at the code and here is a corrected
function to do this. (Only the first lines of the from_csv function)
def from_csv(fp, field_names = None, delimiter=None,**kwargs):
if delimiter is None:
dialect = csv.Sniffer().sniff(fp.read(1024))
fp.seek(0)
reader = csv.reader(fp, dialiect)
else:
reader = csv.reader(fp, delimiter=delimiter)
the rest is the same
Original issue reported on code.google.com by wunio.zi...@gmail.com on 10 Jun 2013 at 8:43
The text was updated successfully, but these errors were encountered:
Hello. Sorry for my very slow action on this. I've just made a commit to
trunk in the SVN repo implementing this. Not only can you specifie a
delimiter, you can pass any of the format parameters that csv.Reader accepts
(delimiter, doublequote, escapechar, etc.). It would be wonderful if you could
give the new code a quick test on your scenario.
Btw, how was PrettyTable failing for you with ";" delimiters? I tried using
the old code on a file with ";" delims, and it worked just fine.
Original comment by luke@maurits.id.au on 5 Oct 2013 at 10:17
Original issue reported on code.google.com by
wunio.zi...@gmail.com
on 10 Jun 2013 at 8:43The text was updated successfully, but these errors were encountered: