parsing CSV files with quotes

Al Christians achrist at easystreet.com
Fri Mar 31 10:36:35 EST 2000


Bob Alexander wrote:
> 
> Here's a Python module I wrote to manage CSVs, and I think it handles the
> cases you care about:
> 
> ------------------- CSV.py ---------------------
> #
> # Functions for handling comma-separated value (CSV) files
> #
> # Lines of a CSV file are represented by lists of their fields.
> # Fields are represented as strings.
> #
> # Comments on handling of special characters in CSV:
> #
> # - Output fields are quoted only if text contains quote or comma
> # - Quotes in quoted text are doubled
> # - Quote after first char treated as normal text
> #
> 

Is there any standard for creating CSV's that will work with all the
major spreadsheets?  

I recently tried to create some and didn't find a method that 
would work right with Excel (Office 95 version), Star Office, and
Quattro Pro (version 8 of WP Offfice, I think).  Doubled quotes,
e.g.  "6"" Nails", didn't work with Excel, as I recall.  Would 
"6\" Nails"  have worked with all these?


Al



More information about the Python-list mailing list