Re: select lines in python

2009-07-15 Thread Rhodri James
On Tue, 14 Jul 2009 20:10:32 +0100, wrote: Can i become more precise like instead of printing all lines for PHE and ASP is it possible that for PHE python will print only those lines which will have information about H and HA and for ASP it will print those lines which will have information

Re: select lines in python

2009-07-15 Thread Pierre Quentel
On 14 juil, 19:33, amr...@iisermohali.ac.in wrote: > Dear all, > > Can anyone tell me that suppose i have a file having content like: > >     _Atom_name >       _Atom_type >       _Chem_shift_value >       _Chem_shift_value_error >       _Chem_shift_ambiguity_code >      1     1   PHE       H     H

Re: select lines in python

2009-07-15 Thread Krishnakant
On Tue, 2009-07-14 at 23:03 +0530, amr...@iisermohali.ac.in wrote: > Dear all, > > Can anyone tell me that suppose i have a file having content like: > > _Atom_name > _Atom_type > _Chem_shift_value > _Chem_shift_value_error > _Chem_shift_ambiguity_code > 1 1

Re: select lines in python

2009-07-14 Thread David Gibb
I think what Grant is saying is that you should read the documentation for the re module. David On Tue, Jul 14, 2009 at 3:12 PM, Grant Edwards wrote: > On 2009-07-14, amr...@iisermohali.ac.in wrote: > >> Can i become more precise like instead of printing all lines >> for PHE and ASP is it possib

Re: select lines in python

2009-07-14 Thread Grant Edwards
On 2009-07-14, amr...@iisermohali.ac.in wrote: > Can i become more precise like instead of printing all lines > for PHE and ASP is it possible that for PHE python will print > only those lines which will have information about H and HA > and for ASP it will print those lines which will have > inf

Re: select lines in python

2009-07-14 Thread amrita
Can i become more precise like instead of printing all lines for PHE and ASP is it possible that for PHE python will print only those lines which will have information about H and HA and for ASP it will print those lines which will have information about HA and HB. Thanks > On Tue, 14 Jul 2009 1

Re: select lines in python

2009-07-14 Thread Rhodri James
On Tue, 14 Jul 2009 18:48:06 +0100, David Gibb wrote: [Something top-posted, which I've shuffled down] On Tue, Jul 14, 2009 at 1:33 PM, wrote: Dear all, Can anyone tell me that suppose i have a file having content like:    _Atom_name      _Atom_type      _Chem_shift_value      _Chem_shift_

Re: select lines in python

2009-07-14 Thread David Gibb
try something like: for line in open("filename").readlines(): if (re.search("PHE|ASP",line): print line On Tue, Jul 14, 2009 at 1:33 PM, wrote: > Dear all, > > Can anyone tell me that suppose i have a file having content like: > >    _Atom_name >      _Atom_type >      _Chem_shift_va

select lines in python

2009-07-14 Thread amrita
Dear all, Can anyone tell me that suppose i have a file having content like: _Atom_name _Atom_type _Chem_shift_value _Chem_shift_value_error _Chem_shift_ambiguity_code 1 1 PHE H H 8.49 0.02 1 2 1 PHE HAH 4.60