Re: [Tutor] Help merge files using python

2013-11-13 Thread Alan Gauld
On 13/11/13 22:26, jarod...@libero.it wrote: I want to obtain A 10 0 60 B 20 45 70 C 30 0 10 Z 0 10 0 Amit has given you a design to solve the problem, however based on your code you may not be able to translate that into code yet. I try to do like this: f = os.listdir(".") for i in f:

Re: [Tutor] Help merge files using python

2013-11-13 Thread Amit Saha
On Thu, Nov 14, 2013 at 8:26 AM, jarod...@libero.it wrote: > Hi I want to merge many files like this: > #file1 > A 10 > B 20 > C 30 > #file2 > B 45 > Z 10 > #file1 > A 60 > B 70 > C 10 > > I want to obtain > > A 10 0 60 > B 20 45 70 > C 30 0 10 > Z 0

[Tutor] Help merge files using python

2013-11-13 Thread jarod...@libero.it
Hi I want to merge many files like this: #file1 A 10 B 20 C 30 #file2 B 45 Z 10 #file1 A 60 B 70 C 10 I want to obtain A 10 0 60 B 20 45 70 C 30 0 10 Z 0 10 0 I try to do like this: f = os.listdir(".") for i in f: T =open(i,"r") for r in t.readli