Hi I have the following awk program
Problem is that I don't know why it complains "awk: –f awk: ^ invalid char '�' in expression" when I do awk -f pdf.awk aodv1.tr
Anyone of you out there who are brighter than me in this area? =)
BEGIN {
recvdSize = 0
startTime = 400
stopTime = 0
}
{
event = $1
time = $265.01
node_id = $29
pkt_size = $8
level = $4
if (level == "AGT" && event == "s" && pkt_size >= 512) {
if (time < startTime) {
startTime = time
}
}
if (level == "AGT" && event == "r" && pkt_size >= 512) {
if (time > stopTime) {
stopTime = time
}
hdr_size = pkt_size % 512
pkt_size -= hdr_size
recvdSize += pkt_size
}
}
END {
printf("Average Throughput[kbps] = %.2f\t\t StartTime=%.2f\tStopTime=%.2f\n",(recvdSize/(stopTime-startTime))*(8/1000),startTime,stopTime)
}