Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Fillmore 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: References: 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 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 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 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...