File: xg2gp.awk

package info (click to toggle)
ns2 2.35%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 78,120 kB
  • sloc: cpp: 172,923; tcl: 107,127; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 812; awk: 525; csh: 355
file content (11 lines) | stat: -rwxr-xr-x 324 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/awk -f
# convert from raw2xg output into gnuplot format
BEGIN {system("rm -f acks packets drops")}
{if (ack) print $1 " " $2 >>"acks"}
{if (pkt) print $1 " " $2 >>"packets"}
{if (drp) print $1 " " $2 >>"drops"}
$1 ~ /^.ack/ {ack=1}
$1 ~ /^.packets/ {pkt=1}
$1 ~ /^.drops/ {drp=1}
$1 ~ /^$/ {ack=0; pkt=0; drp=0}