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 w

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

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

Re: Re: joining two column

2010-05-15 Thread mannu jha
On Sat, 15 May 2010 00:14:05 +0530 wrote >On 05/14/2010 12:55 PM, James Mills wrote: >> file1: >> a1 a2 >> a3 a4 >> a5 a6 >> a7 a8 >> >> file2: >> b1 b2 >> b3 b4 >> b5 b6 >> b7 b8 >> >> and I want to join them so the output should look like this: >> >> a1 a2 b1 b2 >> a3 a4 b3 b4

joining two column

2010-05-14 Thread mannu jha
Hi, I have two different file file1: a1 a2 a3 a4 a5 a6 a7 a8 file2: b1 b2 b3 b4 b5 b6 b7 b8 and I want to join them so the output should look like this: a1 a2 b1 b2 a3 a4 b3 b4 a5 a6 b5 b6 a7 a8 b7 b8 how to do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: column selection

2010-05-07 Thread mannu jha
On Fri, 07 May 2010 18:58:59 +0530 wrote >mannu jha wrote: > On Thu, 06 May 2010 18:54:59 +0530 wrote > >> mannu jha wrote: >> > > >> I tried with this: >> > > > > >> for line in open('1.txt'):

Re: Re: column selection

2010-05-06 Thread mannu jha
in print columns[0], columns[1] IndexError: list index out of range nmru...@caf:~> Thanks, On Thu, 06 May 2010 15:44:07 +0530 wrote >mannu jha wrote: > Hi, > > I have few files like this: > > 24 ALA helix (helix_alpha, helix2) > > > 27 ALA helix (helix_alph

column selection

2010-05-06 Thread mannu jha
Hi, I have few files like this: 24 ALA helix (helix_alpha, helix2) 27 ALA helix (helix_alpha, helix2) 51 ALA helix (helix_alpha, helix4) 58 ALA helix (helix_alpha, helix5) 63 ALA helix (helix_alpha, helix5) now with this program: for line in open('1.txt'): columns = line.spl

[no subject]

2010-04-30 Thread mannu jha
Dear all, I am trying my problem in this way: import re expr = re.compile("Helix Helix| Sheet Sheet| Turn Turn| Coil Coil") f = open("CalcSecondary4.txt") for line in f: if expr.search(line): print line but with this it is printing only those line in which helix, sheet, turn and coil

[no subject]

2010-04-28 Thread mannu jha
Dear all, I have a file like: 1 ALA Helix Sheet Helix Coil 2 ALA Coil Coil Coil Sheet 3 ALA Helix Sheet Coil Turn now what I want is that write a python program in which I will put the condition that in each line whatever secondary structure is coming more than or equal to two times it should

Re: Re: how to select column

2010-04-26 Thread mannu jha
5,-0.2 0.843 111.7 60.4 -55.3 -36.8 34.6 28.8 -8.2 and in the output I want just: 2 A I 3 A R>> - 4 A P H 3> S+ i.e. residue no., aa and seconday structure. Thanks On Mon, 26 Apr 2010 20:40:55 +0530 wrote >mannu jha wrote: > Dear all, > > I am new in python

how to select column

2010-04-26 Thread mannu jha
Dear all, I am new in python, can anyone help me that how can I select two column out of 6 column from a file. For example if I have file like: a1 a2 a3 a4 a5 a6 b1 b2 b3 b4 b5 b6 c1 c2 c3 c4 c5 c6 d1 d2 d3 d4 d5 d6 and I want output like: a1 a4 b1 b4 c1 c4 d1 d4 then how to do Thanks -- h