Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv unix file format ('\n' line terminator) #50225

Closed
jtalbot mannequin opened this issue May 8, 2009 · 4 comments
Closed

csv unix file format ('\n' line terminator) #50225

jtalbot mannequin opened this issue May 8, 2009 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@jtalbot
Copy link
Mannequin

jtalbot mannequin commented May 8, 2009

BPO 5975
Nosy @birkenfeld, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-10-27.07:27:23.678>
created_at = <Date 2009-05-08.22:31:08.961>
labels = ['type-feature', 'library']
title = "csv unix file format ('\\n' line terminator)"
updated_at = <Date 2010-10-27.07:27:23.676>
user = 'https://bugs.python.org/jtalbot'

bugs.python.org fields:

activity = <Date 2010-10-27.07:27:23.676>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2010-10-27.07:27:23.678>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2009-05-08.22:31:08.961>
creator = 'jtalbot'
dependencies = []
files = []
hgrepos = []
issue_num = 5975
keywords = []
message_count = 4.0
messages = ['87479', '87830', '87841', '119678']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'terry.reedy', 'jtalbot']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue5975'
versions = ['Python 2.7', 'Python 3.2']

@jtalbot
Copy link
Mannequin Author

jtalbot mannequin commented May 8, 2009

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.

@jtalbot jtalbot mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels May 8, 2009
@terryjreedy
Copy link
Member

New features must be targeted at 2.7/3.2. 2.5 is in security-fix only
mode and 2.6 in bug-fix only mode, as is 3.0. 3.1 is in beta with new
features pretty well frozen.

@jtalbot
Copy link
Mannequin Author

jtalbot mannequin commented May 15, 2009

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.

@birkenfeld
Copy link
Member

Added in r85856.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants