Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Joel Goldstick
I haven't worked through the reading of the files, but once you have the matching lines from each you can process like this: def split_and_combine(l1, l2): first = l1.split(', ') second = l2.split(', ') combined = first[:4] + second[1:4] return combined Then write the value to the output

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Nitin Das
I think in both the while loops , for loops are iterating over the new lines, as a result col1,col2,col3,col4,col5,col6,col7 as a result after both the while loop finishes these colums would only be having the values of the last lines from both the files. as a result the new file3 would only be hav

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Alan Gauld
"nitin chandra" wrote in message news:aanlktimjrqfh=tdqtric7=utfgbxjcgaaai9coynn...@mail.gmail.com... Hello All, I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and write them into a 3rd file 'file3', 7 colum

Re: [Tutor] reading from 2 file output to 1

2010-08-17 Thread Evert Rol
> I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) > columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and > write them into a 3rd file 'file3', 7 columns string. The data is > Numeric values both, +ve and -ve. > > this is how i was trying. > >

[Tutor] reading from 2 file output to 1

2010-08-17 Thread nitin chandra
Hello All, I am trying to read from 2 CSV files, where first 4 ([0,1,2,3]) columns are read from 'file1' and 3 columns ([1,2,3]) from 'file2' and write them into a 3rd file 'file3', 7 columns string. The data is Numeric values both, +ve and -ve. this is how i was trying.