Hi,

just try the good old awk!

excample:

$ awk 'BEGIN     {sum=0} \
>                {sum += $14+$15} \
>      END       {print "\nSUM: " sum}' logfile.txt


line BEGIN : initialzes the variable (sum)
next line  : adds to variable the colums 14 and 15 (colums separated by one ore
more blanks)
line END   : prints sum (of course you might want to see the result of adding);
logfile.txt is the input file.

please tell me if it worked.

greetings from good old germany

bernd

-----Ursprungliche Nachricht-----
Von: Markus Gufler [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 14. November 2003 11:27
An: [EMAIL PROTECTED]
Betreff: [Declude.JunkMail] OT: unixtools help


Hi

Is there someone who can help me how to do this with unix tools:
I want to sum up the two colums sc-bytes and cs-bytes from a logfile (see
attachment).

The output should be something like

sc-bytes cs-bytes
2346465 8334526

Markus
---
[This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.

Reply via email to