Re: [Tutor] How parse files in function of number of lines

2014-05-29 Thread Wolfgang Maier
On 28.05.2014 21:16, jarod...@libero.it wrote: Dear all! I have two example files: tmp.csv: namevalue root mark34 yes tmp2.csv namevalue root I want to print a different text if I have more than one row and if I have only one row. My code is this: with open("tmp.csv") as p

Re: [Tutor] How parse files in function of number of lines

2014-05-29 Thread Dave Angel
"jarod...@libero.it" Wrote in message: > Dear all! > I have two example files: > tmp.csv: > name value root > mark 34 yes > > tmp2.csv > name value root > > > I want to print a different text if I have more than one row and if I have > only one row. My code is this: > with open("tm

Re: [Tutor] How parse files in function of number of lines

2014-05-28 Thread Alan Gauld
On 28/05/14 20:16, jarod...@libero.it wrote: Dear all! I have two example files: tmp.csv: namevalue root mark34 yes tmp2.csv namevalue root I understood down to here. I want to print a different text if I have more than one row and if I have only one row. This is not

[Tutor] How parse files in function of number of lines

2014-05-28 Thread jarod...@libero.it
Dear all! I have two example files: tmp.csv: namevalue root mark34 yes tmp2.csv namevalue root I want to print a different text if I have more than one row and if I have only one row. My code is this: with open("tmp.csv") as p: header =p.next() for i in p: p