Re: Question on the csv library

2009-08-28 Thread Simon Brunning
2009/8/28 John Machin sjmac...@lexicon.net: Mark, there exist parallel universes the denizens of which use strange notation e.g. 1.234,56 instead of 1,234.56 When displaying data, sure. and would you believe they use ';' instead of ',' as a list separator ... CSV is a data transfer format,

Re: Question on the csv library

2009-08-28 Thread Mark Lawrence
John Machin wrote: On Aug 28, 6:44 am, Mark Lawrence breamore...@yahoo.co.uk wrote: vsoler wrote: On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid 1- the csv file was generated with Excel 2007; no prompts for what the separator should be; Excel has used ; by default, without

Re: Question on the csv library

2009-08-28 Thread Andreas Waldenburger
On Fri, 28 Aug 2009 09:03:49 +0100 Mark Lawrence breamore...@yahoo.co.uk wrote: p.s. is it separator or seperator, after 50+ years I still can't remember? The former. It's cognate to English part if that helps any. /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on the csv library

2009-08-28 Thread Steven Rumbalski
On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done: import csv spamReader = csv.reader(open('C:\\abc.csv', 'r')) print spamReader

Re: Question on the csv library

2009-08-28 Thread vsoler
On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done:

Re: Question on the csv library

2009-08-28 Thread Gabriel Genellina
En Fri, 28 Aug 2009 13:35:19 -0300, vsoler vicente.so...@gmail.com escribió: On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. ['a;qwe;1'] ['b;asd;2']

Re: Question on the csv library

2009-08-28 Thread David Smith
vsoler wrote: Thank you very much for all your comments. After reading them I can conclude that: 1- the CSV format is not standardized; each piece of software uses it differently True, but there are commonalities. See http://en.wikipedia.org/wiki/Comma-separated_values 2- the C in

Re: Question on the csv library

2009-08-28 Thread Mark Lawrence
vsoler wrote: On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done:

Re: Question on the csv library

2009-08-28 Thread Hrvoje Niksic
David Smith d...@cornell.edu writes: 2- the C in CSV does not mean comma for Microsoft Excel; the ; comes from my regional Spanish settings The C really does stand for comma. I've never seen MS spit out semi-colon separated text on a CSV format. That's because you're running MS Office in a

Re: Question on the csv library

2009-08-28 Thread John Machin
On Aug 29, 2:35 am, vsoler vicente.so...@gmail.com wrote: 3- Excel does not even put quotes around litteral texts, not even when the text contains a blank Correct. Quoting is necessary only if a text field contains a delimiter (semicolon/comma), a newline, or the quote character. You can read

Question on the csv library

2009-08-27 Thread vsoler
I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done: import csv spamReader = csv.reader(open('C:\\abc.csv', 'r')) print spamReader _csv.reader object at 0x01022E70 for row in spamReader:

Re: Question on the csv library

2009-08-27 Thread Benjamin Kaplan
On Thu, Aug 27, 2009 at 3:06 PM, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done: import csv spamReader = csv.reader(open('C:\\abc.csv', 'r'))

Re: Question on the csv library

2009-08-27 Thread Andreas Waldenburger
On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger use...@geekmail.invalid wrote: [snip] Might I humbly suggest sheet = list(spamReader) # ? Oh, and while I'm humbly suggesting: spam_reader instead of spamReader or SpamReader or SpamrEadeR or suchlike. Caps are reserved for

Re: Question on the csv library

2009-08-27 Thread vsoler
On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid wrote: On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger use...@geekmail.invalid wrote: [snip] Might I humbly suggest sheet = list(spamReader)  # ? Oh, and while I'm humbly suggesting: spam_reader instead of

Re: Question on the csv library

2009-08-27 Thread Andreas Waldenburger
On Thu, 27 Aug 2009 13:12:07 -0700 (PDT) vsoler vicente.so...@gmail.com wrote: On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid wrote: [snip what I wrote] Thank you for your answers. Let me however make some comments: 1- the csv file was generated with Excel 2007; no

Re: Question on the csv library

2009-08-27 Thread Mark Lawrence
vsoler wrote: On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid wrote: On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger use...@geekmail.invalid wrote: [snip] Might I humbly suggest sheet = list(spamReader) # ? Oh, and while I'm humbly suggesting: spam_reader instead

Re: Question on the csv library

2009-08-27 Thread John Machin
On Aug 28, 6:44 am, Mark Lawrence breamore...@yahoo.co.uk wrote: vsoler wrote: On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid 1- the csv file was generated with Excel 2007; no prompts for what the separator should be; Excel has used ; by default, without asking anything