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

inshu chauhan insideshoes at gmail.com
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
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130128/139d4bc9/attachment.html>


More information about the Python-list mailing list