searching for the number of occurences of a string

M.N.A.Smadi smadim2 at grads.ece.mcmaster.ca
Sun Mar 5 19:30:53 EST 2006


hi;
say i have a text file with a string ( say '(XYZ)') and I want to find 
the number of line where this string has occured. What is the best way 
to do that?

what about if that string was say a 0 with leading and trailing white 
spaces, would that be any different?

thanks
moe smadi



More information about the Python-list mailing list