Re: How do I read .csv files

2021-03-16 Thread Alan Gauld via Python-list
On 16/03/2021 16:15, The Cool Life wrote: > Try importing the CSV module. That might help! And for the removal of doubt it is spelled csv 9lower case) And it looks like you want to read about the DictReader class within it. The csv module docs include several examples. -- Alan G Author of the L

Re: How do I read .csv files

2021-03-16 Thread The Cool Life
Try importing the CSV module. That might help! > On Mar 16, 2021, at 6:27 AM, Gys wrote: > > On 3/12/21 11:28 AM, Johann Klammer wrote: >> Specifically ones with quoted strings. I'll have whitespace in >> there and possibly escaped quotechars. >> maybe newlines too. >> Which means that pyparsi

Re: How do I read .csv files

2021-03-16 Thread Benjamin Schollnick
The best answer is to use the CSV library, but there are wrappers around it. For example, I use a wrapper of my own creation (csv_common.py) @ https://github.com/bschollnick/bas_Utilities . The main benefit is that I can create variant CSV’s by just

Re: How do I read .csv files

2021-03-16 Thread Gys
On 3/12/21 11:28 AM, Johann Klammer wrote: Specifically ones with quoted strings. I'll have whitespace in there and possibly escaped quotechars. maybe newlines too. Which means that pyparsing commaSeparatedList.parseString(line) won't work. I also like to edit them for visual alignment, so there