Hi all!

I have a file with data structure derived from wvdial log:
Oct 14 11:03:45 cc000002695 pppd[3092]: Sent 3489538 bytes, received
43317854 bytes.

I want to get the 10th field of each line and get the sum for all lines
(total my net data usage). In awk u can easily pop it using field variables
e..g $10. Since im learning python on my own i thought this is a good way to
learn but im stumped how to achieve this goal.
I used open() and read line method to store the contents in a list but it is
a list of string. I need it to be numbers. Iterating through the string list
definitely is unwieldy. Can you guys advise best way how?

FWIW im a self learner and just relying from tutorial materials and this
medium to learn python. Lead me to the right direction please :-)

My IDE is vim and ipython in debian linux.


-- 
Best Regards,
bibimidi
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to