collecting data from file

Mustafa Celik mustafa.celik at
Fri Apr 11 09:41:23 CEST 2003

I want to scroll thru a file;
   * find lines that match a string (e.g. HELLO) on the 2nd column
   * add up the 4th column (an integer) on each matching line, say the 
variable is TOTAL
   * subtract the 4th column from TOTAL if another is string (e.g. BYE) 
is hit on 2nd column of a line

Any tips?

More information about the Python-list mailing list