[issue5975] csv unix file format ('\n' line terminator)

2009-05-08 Thread Jay Talbot

New submission from Jay Talbot :

I was having issues importing a csv file generated by the csv.write
class with the following:

load data infile 'file.csv' replace into table en fields terminated by
',' enclosed by '"' lines terminated by '\r\n';

To help prevent this from happening again, I would like to see the
following added to the csv.py library:

class unix_dialect(Dialect):
"""Describe the usual properties of unix-generated CSV files."""
delimiter = ','
quotechar = '"'
doublequote = True
skipinitialspace = False
lineterminator = '\n'
quoting = QUOTE_ALL
register_dialect("unix_dialect", unix_dialect)

The above code is the excel class dialect with '\n' line termination and
quoting of all fields. This allows for easy csv file import into mysql
databases.

--
components: Library (Lib)
messages: 87479
nosy: jtalbot
severity: normal
status: open
title: csv unix file format ('\n' line terminator)
type: feature request
versions: Python 2.5, Python 2.6, Python 3.0

___
Python tracker 
<http://bugs.python.org/issue5975>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5975] csv unix file format ('\n' line terminator)

2009-05-15 Thread Jay Talbot

Jay Talbot  added the comment:

I'm sorry. I will remember to try and look up where the new features are
being targeted. Reporting bugs and requesting new features here is new
to me. Everyone seems to have their own rules.

--

___
Python tracker 
<http://bugs.python.org/issue5975>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com