Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: > Hi everyone, > > > > I am a beginner in python and trying to find my way through... :) > > > > I am writing a script to get numbers from the headers of a text file. > > > > If

lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('>scaffold_1') I just use: h01.lstrip('>scaffold_') and this returns me '1' But, if the header is: h02: ('

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: > Hi everyone, > > > > I am a beginner in python and trying to find my way through... :) > > > > I am writing a script to get numbers from the headers of a text file. > > > > If

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: > Hi everyone, > > > > I am a beginner in python and trying to find my way through... :) > > > > I am writing a script to get numbers from the headers of a text file. > > > > If

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: > Hi everyone, > > > > I am a beginner in python and trying to find my way through... :) > > > > I am writing a script to get numbers from the headers of a text file. > > > > If

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:41:43 AM UTC-4, Fábio Santos wrote: > On 4 Jun 2013 16:34, "mstagliamonte" wrote: > > > > > > On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: > > > > Hi everyone, > > > > > > > >

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:48:55 AM UTC-4, MRAB wrote: > On 04/06/2013 16:21, mstagliamonte wrote: > > > Hi everyone, > > > > > > I am a beginner in python and trying to find my way through... :) > > > > > > I am writing a scrip

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
Thanks to everyone! I didn't expect so many replies in such a short time! Regards, Max -- http://mail.python.org/mailman/listinfo/python-list

Extracting lines from text files - script with a couple of 'side effects'

2013-09-25 Thread mstagliamonte
Dear All, Here I am, with another newbie question. I am trying to extract some lines from a fasta (text) file which match the headers in another file. i.e: Fasta file: >header1|info1:info2_info3 general text >header2|info1:info2_info3 general text headers file: header1|info1:info2_info3 header2|

Re: Extracting lines from text files - script with a couple of 'side effects'

2013-09-26 Thread mstagliamonte
Hi, Thanks for the answers! And Dave, thanks for explaining the cause of the problem I will keep that in mind for the future. You're right, I am doing the search backward, it just seemed easier for me to do it in that way. Looks like I need to keep practising... Both your suggestions work, I w