Carlos Grohmann wrote:
>
>Hi all, I'm using csv to read text files, and its working fine, except
>in two cases:
>
>- when there is only one line of text (data) in the file
>- when there is a blank line after the last data line
>dialect = csv.Sniffer().sniff(sample) # Check for file format wit
On 2010-06-03, Carlos Grohmann wrote:
>> Use:
>> ? ?csvfile = csv.reader(csvfile, dialect=dialect)
>> dialect is a keyword argument.
>
> thanks for pointing that out.it stopped the errors when there s
> only one data line, but it still can't get the values for that
> line
Is it possible your data
Thanks for your prompt response, Neil.
> That data doesn't appear to be csv worthy. Why not use str.split
> or str.partition?
Well, I should have said that this is one kind of data. The function
is part of a larger app, and there is the possibility that someone
uses headers in the data files, or
On 2010-06-03, Neil Cerutti wrote:
> Do you really need to use the Sniffer? You'll probably be better
> off...
...defining your own dialect based on what you know to be the
file format.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2010-06-03, Carlos Grohmann wrote:
> Hi all, I'm using csv to read text files, and its working fine, except
> in two cases:
>
> - when there is only one line of text (data) in the file
> - when there is a blank line after the last data line
>
> this is the kind of data:
>
> 45 67 89
> 23 45 06
Hi all, I'm using csv to read text files, and its working fine, except
in two cases:
- when there is only one line of text (data) in the file
- when there is a blank line after the last data line
this is the kind of data:
45 67 89
23 45 06
12 34 67
...
and this is the function:
def getData(pa
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>
>does the CSV format even support Unicode-encoded data streams?
Since there is no RFC or ISO standard for CSV, I'd say the answer was
"yes".
I just tried it with Excel, which is probably as close as we can get to the
canonical csv application. It can
On Wed, 11 May 2005 23:52:56 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote:
>John Machin <[EMAIL PROTECTED]> writes:
>> The CSV format is not defined at all, AFAIK.
>
>Just for the record, http://www.ietf.org/internet-drafts/draft-shafranovich-mime-csv-05.txt
>
" Bletch" ,"""Bletch""", "Ble
John Machin <[EMAIL PROTECTED]> writes:
> The CSV format is not defined at all, AFAIK.
Just for the record, http://www.ietf.org/internet-drafts/draft-shafranovich-mime-csv-05.txt
>. You'll also see application that deal with the application/csv MIME
type.
http://www.mire
On Wed, 11 May 2005 20:02:25 +0200, "Fredrik Lundh"
<[EMAIL PROTECTED]> wrote:
>Skip Montanaro wrote:
>
>> Fredrik> does the CSV format even support Unicode-encoded data streams?
>>
>> Based on the requests I've seen here and on the [EMAIL PROTECTED] mailing
>> list,
>> it appears people are
On Wed, 11 May 2005 14:08:08 -0500, Skip Montanaro <[EMAIL PROTECTED]>
wrote:
>
>>> Based on the requests I've seen here and on the [EMAIL PROTECTED]
> mailing
>>> list, it appears people are certainly generating CSV files which
>>> contain Unicode- encoded data.
>
>Fredrik> in wh
>> Based on the requests I've seen here and on the [EMAIL PROTECTED] mailing
>> list, it appears people are certainly generating CSV files which
>> contain Unicode- encoded data.
Fredrik> in what encodings?
I've seen hints about iso-8859-1/iso-8859-15 and mention that Excel 2000
Skip Montanaro wrote:
> Fredrik> does the CSV format even support Unicode-encoded data streams?
>
> Based on the requests I've seen here and on the [EMAIL PROTECTED] mailing
> list,
> it appears people are certainly generating CSV files which contain Unicode-
> encoded data.
in what encoding
Fredrik> does the CSV format even support Unicode-encoded data streams?
Based on the requests I've seen here and on the [EMAIL PROTECTED] mailing list,
it appears people are certainly generating CSV files which contain
Unicode-encoded data.
Skip
--
http://mail.python.org/mailman/listinfo/py
Richie Hindle wrote:
> [Florian]
> > You mean that csv.reader can't work with unicode as the delimiter parameter?
>
> Exactly. http://www.python.org/doc/2.3.5/lib/module-csv.html says:
>
> "Note: This version of the csv module doesn't support Unicode input. Also,
> there are currently some issues
>> You mean that csv.reader can't work with unicode as the delimiter
>> parameter?
Richie> Exactly
Richie> "Note: This version of the csv module doesn't support Unicode
Richie> input
Richie> That note is still there in the current development docs, so it
Rich
[Florian]
> How can I convert Unicode to ASCII?
You're writing code using Unicode and you don't know how to convert it
ASCII? You need to do some reading. Here are a few links - Google can
provide many more:
http://docs.python.org/tut/node5.html#SECTION00513
http://diveinto
Richie Hindle wrote:
>
> [Florian]
>> You mean that csv.reader can't work with unicode as the delimiter
>> parameter?
>
> Exactly. http://www.python.org/doc/2.3.5/lib/module-csv.html says:
>
> "Note: This version of the csv module doesn't support Unicode input. Also,
> there are currently some
[Florian]
> You mean that csv.reader can't work with unicode as the delimiter parameter?
Exactly. http://www.python.org/doc/2.3.5/lib/module-csv.html says:
"Note: This version of the csv module doesn't support Unicode input. Also,
there are currently some issues regarding ASCII NUL characters.
Richie Hindle wrote:
>
> [Florian]
>> I've one problem using the csv module.
>> The code:
>>
>> self.reader = csv.reader(f, delimiter = ",")
>>
>> works perfectly. But when I use a variable for delimiter:
>>
>> self.reader = csv.reader(f, delimiter = Adelimiter)
>>
>> I get th
[Florian]
> I've one problem using the csv module.
> The code:
>
> self.reader = csv.reader(f, delimiter = ",")
>
> works perfectly. But when I use a variable for delimiter:
>
> self.reader = csv.reader(f, delimiter = Adelimiter)
>
> I get the traceback:
>
>
> File "/home/fl
Hello,
I've one problem using the csv module.
The code:
self.reader = csv.reader(f, delimiter = ",")
works perfectly. But when I use a variable for delimiter:
self.reader = csv.reader(f, delimiter = Adelimiter)
I get the traceback:
File "/home/florian/visualizer/ConfigReader.
22 matches
Mail list logo