Re: Re: joining files

2010-05-18 Thread mannu jha
On Mon, 17 May 2010 23:57:18 +0530 wrote >Try: file = open("input11.txt") file1 = file.read() # file1 is a string file.close() or file1 = open("input11.txt") # file1 is an open file object and replace lines: for line in sce.split(os.linesep): lst = line.split() lines[lst[0]] =

Fw: Re: Re: joining files

2010-05-18 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: "mannu jha"mannu_0...@rediffmail.com To: tuomas.vesteri...@iki.fi Subject: Re: Re: joining files--- Begin Message --- > import os > def merge_sources(sources): > # sources is a list of tuples (source_name, so

Fw: Re: Re: Re: joining files

2010-05-17 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: "mannu jha"mannu_0...@rediffmail.com To: mannu_0...@rediffmail.com Subject: Re: Re: Re: joining files--- Begin Message --- On Sun, 16 May 2010 23:51:10 +0530 wrote >On 05/16/2010 05:04 PM, Dave Angel wrote: > (You f

Re: Re: joining files

2010-05-17 Thread mannu jha
On Sun, 16 May 2010 23:51:10 +0530 wrote >On 05/16/2010 05:04 PM, Dave Angel wrote: > (You forgot to include the python-list in your response. So it only > went to me. Normally, you just do reply-all to the message) > mannu jha wrote: >> On Sun, 16 May 2010 13:52:31 +0530 wrote >>> mannu jha wrot

Re: joining files

2010-05-17 Thread Dave Angel
mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22

Re: joining files

2010-05-16 Thread Tuomas Vesterinen
On 05/16/2010 05:04 PM, Dave Angel wrote: (You forgot to include the python-list in your response. So it only went to me. Normally, you just do reply-all to the message) mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22

Re: joining files

2010-05-16 Thread Aahz
In article , Chris Rebert wrote: > >-- > That's not funny. I'm sure I'd have little difficulty finding poor programmers of whatever demographic groups you belong to. Or perhaps you haven't noticed that PEBKACs are everywhere? -- Aahz (a...@pythoncraft.com) <*> http://www.pyt

Re: joining files

2010-05-16 Thread Dave Angel
(You forgot to include the python-list in your response. So it only went to me. Normally, you just do reply-all to the message) mannu jha wrote: On Sun, 16 May 2010 13:52:31 +0530 wrote mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 2

Fw: Re: Re: joining files

2010-05-16 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: "mannu jha"mannu_0...@rediffmail.com To: da...@ieee.org Subject: Re: Re: joining files--- Begin Message --- On Sun, 16 May 2010 13:52:31 +0530 wrote >mannu jha wrote: > Hi, > > I have few files like thi

Re: joining files

2010-05-16 Thread Dave Angel
mannu jha wrote: Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in all these files first column is the main source of matching their entrie

Re: joining files

2010-05-16 Thread Chris Rebert
On Sun, May 16, 2010 at 12:02 AM, mannu jha wrote: > Hi, > > I have few files like this: > file1: > 22 110.1 > 33 331.5 22.7 > 5 271.9 17.2 33.4 > 4 55.1 > > file1 has total 4 column but some of them are missing in few row. > > file2: > 5 H > 22 0 > > file3: > 4 T > 5 B > 22 C > 121 S > > in all t

Re: joining files

2010-05-16 Thread James Mills
On Sun, May 16, 2010 at 5:02 PM, mannu jha wrote: > Hi, > > I have few files like this: > file1: > 22 110.1 > 33 331.5 22.7 > 5 271.9 17.2 33.4 > 4 55.1 > > file1 has total 4 column but some of them are missing in few row. > > file2: > 5 H > 22 0 > > file3: > 4 T > 5 B > 22 C > 121 S > > in all th

joining files

2010-05-16 Thread mannu jha
Hi, I have few files like this: file1: 22 110.1 33 331.5 22.7 5 271.9 17.2 33.4 4 55.1 file1 has total 4 column but some of them are missing in few row. file2: 5 H 22 0 file3: 4 T 5 B 22 C 121 S in all these files first column is the main source of matching their entries. So What I want i