Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104635

Re: issue with CVS module

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:32:19 -0500
Organization Aioe.org NNTP Server
Lines 30
Message-ID <nbva0l$1m7a$1@gioia.aioe.org> (permalink)
References <nbv71v$1fj8$1@gioia.aioe.org> <mailman.3.1457726734.12893.python-list@python.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:104635

Show key headers only | View raw


On 3/11/2016 3:05 PM, Joel Goldstick wrote:
>
> Enter the python shell.  Import csv
>
> then type help(csv)
>
> It is highly configurable
>

Possibly, but I am having a hard time letting it know that it should 
leave each and every char alone, ignore quoting and just handle strings 
as strings. I tried playing with the quoting related parameters, to no 
avail:

Traceback (most recent call last):
   File "./myscript.py", line 47, in <module>
     myReader = csv.reader(csvfile, delimiter='\t',quotechar='')
TypeError: quotechar must be set if quoting enabled

I tried adding CVS.QUOTE_NONE, but things get messy :(

Traceback (most recent call last):
   File "./myscript.py", line 64, in <module>
     sys.stdout.write("\t"+row[h])
IndexError: list index out of range

Sorry for being a pain, but I am porting from Perl and  split 
/\t/,$line; was doing the job for me. Maybe I should go back to split on 
'\t' for python too...

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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