Reading data from 2 different files and writing to a single file

inshu chauhan insideshoes at
Mon Jan 28 15:24:49 CET 2013

> In that case, Dave's suggestion to read into a list and iterate over
> the list is to be strongly considered. But I'm not entirely sure what
> your goal is here. Are you trying to make the Cartesian product of the
> two files, where you have one line in the output for each possible
> pair of matching lines? That is, for each line in the first file, you
> make a line in the output for each line in the second? That's what
> your code will currently do.

No , I dont want that , actually both files have equal no of lines, I want
to read the first line of f1 , take 2 datas from it, nd then read first
line of f2, take data from it,
then print them to the same first line of new file i.e nf.

> ChrisA
> --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list