Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #104636
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Fillmore <fillmore_remove@hotmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: issue with CVS module |
| Date | Fri, 11 Mar 2016 15:49:31 -0500 |
| Organization | Aioe.org NNTP Server |
| Lines | 27 |
| Message-ID | <nbvb0s$1nps$1@gioia.aioe.org> (permalink) |
| References | <nbv71v$1fj8$1@gioia.aioe.org> |
| NNTP-Posting-Host | SxA1UDOcaYBihz5zYbn9yQ.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.python:104636 |
Show key headers only | View raw
On 3/11/2016 2:41 PM, Fillmore wrote:
> Is there some directive I can give CVS reader to tell it to stop
> screwing with my text?
OK, I think I reproduced my problem at the REPL:
>>> import csv
>>> s = '"Please preserve my doublequotes"\ttext1\ttext2'
>>> reader = csv.reader([s], delimiter='\t')
>>> for row in reader:
... print(row[0])
...
Please preserve my doublequotes
>>>
:(
How do I instruct the reader to preserve my doublequotes?
As an aside. split() performs the job correctly...
>>> allVals = s.split("\t")
>>> print(allVals[0])
"Please preserve my doublequotes"
>>>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 14:41 -0500
Re: issue with CVS module Joel Goldstick <joel.goldstick@gmail.com> - 2016-03-11 15:05 -0500
Re: issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 15:32 -0500
Re: issue with CVS module mm0fmf <none@invalid.com> - 2016-03-11 21:04 +0000
Re: issue with CVS module Ben Finney <ben+python@benfinney.id.au> - 2016-03-12 08:13 +1100
Re: issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 15:49 -0500
Re: issue with CVS module MRAB <python@mrabarnett.plus.com> - 2016-03-11 21:14 +0000
Re: issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 16:23 -0500
Re: issue with csv module (subject module name spelling correction, too) "Martin A. Brown" <martin@linux-ip.net> - 2016-03-11 13:20 -0800
Re: issue with CVS module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-11 21:15 +0000
Re: issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 16:26 -0500
Re: issue with CVS module alister <alister.ware@ntlworld.com> - 2016-03-12 09:49 +0000
Re: issue with CVS module Fillmore <fillmore_remove@hotmail.com> - 2016-03-11 16:29 -0500
csiph-web