collecting data from file

Mustafa Celik mustafa.celik at sympatico.ca
Fri Apr 11 03:41:23 EDT 2003


Hi,
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