P
Paddy McCarthy
Hi,
I read http://radio.weblogs.com/0124960/ which has a quoted number in
a csv file being interpreted as a string.
I checked it out with my csv2txt utility
(http://www.paddyx.pwp.blueyonder.co.uk/)
And that does seem to be the case.
Should this action not be thought of as an error?
If the csv module reads a quoted string shouldn't it present it
internally as a string?
Since the csv reader is intelligent, maybe the correct proceedure
would be for it to:
* If it only sniffs out numbers held in strings then change all
strings containing valid numbers to numbers.
* If it initially sniffs out unquoted numbers, or no numbers at all,
or a mixture of quoted and unquoted numbers, then return un-quoted
numbers as numbers and quoted numbers as strings.
Or we could explicitely tell the CSV module what to do with quoted
number strings!
I haven't checked what the csv writer does with a string that could
also represent a number. Will it quote that on output? hmmm...
Cheers, Paddy.
I read http://radio.weblogs.com/0124960/ which has a quoted number in
a csv file being interpreted as a string.
I checked it out with my csv2txt utility
(http://www.paddyx.pwp.blueyonder.co.uk/)
And that does seem to be the case.
Should this action not be thought of as an error?
If the csv module reads a quoted string shouldn't it present it
internally as a string?
Since the csv reader is intelligent, maybe the correct proceedure
would be for it to:
* If it only sniffs out numbers held in strings then change all
strings containing valid numbers to numbers.
* If it initially sniffs out unquoted numbers, or no numbers at all,
or a mixture of quoted and unquoted numbers, then return un-quoted
numbers as numbers and quoted numbers as strings.
Or we could explicitely tell the CSV module what to do with quoted
number strings!
I haven't checked what the csv writer does with a string that could
also represent a number. Will it quote that on output? hmmm...
Cheers, Paddy.