how to get no value

Diez B. Roggisch deets at nospam.web.de
Fri Jul 24 12:56:16 CEST 2009


amrita at iisermohali.ac.in schrieb:
> Hi,
> 
> I have a file having lines:-
> 
> 48 ALA H = 8.33 N = 120.77 CA = 55.18 HA = 4.12 C = 181.50
> 104 ALA H = 7.70 N = 121.21 CA = 54.32 HA = 4.21 C =
> 85 ALA H = 8.60 N =  CA =  HA = 4.65 C =
> 
> Now i want to make two another file in which i want to put those lines for
> which C is missing and another one for which N,CA and C all are missing,
> 
> I tried in this way:
> import re
> f = open('chem.txt')
> for line in f:
>      if re.search('C = ',''):
>         print line
> 
> but i am not getting the desired output.


Gosh. Must be groundhog-day. Again.

And there is me thinking that my job could be endangered by cheap & 
qualified indian soft-workers - can't be to many of them around if the 
OP doesn't get a hold of one for the better part of a month now. Must be 
one of those management myths they tell you to scare you into a less 
well paid contract...

Diez



More information about the Python-list mailing list