Re: [Tutor] Problem on filtering data

2015-06-08 Thread Steven D'Aprano
On Mon, Jun 08, 2015 at 04:50:13PM +0200, jarod_v6--- via Tutor wrote: > Dear All; > I have a very silly problem. The right way to handle CSV files is to use the csv module: https://docs.python.org/2/library/csv.html http://pymotw.com/2/csv/ Some more comments further below. > with open("Dati_

Re: [Tutor] Problem on filtering data

2015-06-08 Thread Alan Gauld
On 08/06/15 15:50, jarod_v6--- via Tutor wrote: with open("Dati_differenzialigistvsminigist_solodiff.csv") as p: You are usually better off processing CSV files (or in your case tab separated) using the CSV module. for i in p: lines = i.strip("\n").split("\t") if lin

[Tutor] Problem on filtering data

2015-06-08 Thread jarod_v6--- via Tutor
Dear All; I have a very silly problem. with open("Dati_differenzialigistvsminigist_solodiff.csv") as p: for i in p: lines = i.strip("\n").split("\t") if lines[8] != "NA": if lines[8] : print lines[8] Why I continue to obtain "" empity line? "bas