Sum talk time in bash

Hello, guys !
I need a little help :slight_smile:

Lets say i have log files with "n" calls like this one :

""""" <+825080825462>","+825080825462","60197774588","from-internal",
"SIP/518-00013e14","SIP/eu.test.com_outgoing-00013e15","Dial",
"SIP/eu.test.com_outgoing/001110260196544577,300,T","2018-01-08 02:40:10",
"2018-01-08 02:40:47","2018-01-08 02:40:54","44.132781","56.755853","ANSWERED",

Talk time is 56 seconds (56.755853). I need command line, which sums the total talk time for the whole file.

Regards,
DF

Where exactly are you stuck?

Well, i tried to do it with that command line, but i didnt succeeded.

awk -F "," '{x+=$14}END{printf "%.0f", x}' FebruaryTest > FebTestCount.txt
awk -F, '{gsub("[^-+0-9.,]","",$(NF-2));s+=$(NF-2)}END{print s}' myFile
1 Like

Thanks, it worked like a charm.