Skip to content
Snippets Groups Projects
create-csv.sh 852 B
Newer Older

set -x
results_folder="../results/"

# Add the header
Ashwin Rao's avatar
Ashwin Rao committed
echo "Location,Technology,ts_relay,ts_client" > timestamps.csv
echo "Location,Technology,rtt" > ping.csv

# Add the prefix to the timestamps and concatenate it to a final-csv
Ashwin Rao's avatar
Ashwin Rao committed
for techiter in "eth Ethernet" "wifinopower Wi-Fi (PD)" "wifipower Wi-Fi (PE)" "5Gping 5G (PD)" "5Gnoping 5G (PE)"
Ashwin Rao's avatar
Ashwin Rao committed
  set -- $techiter
  tech=$1
Ashwin Rao's avatar
Ashwin Rao committed
  techstr=$2' '$3
Ashwin Rao's avatar
Ashwin Rao committed

Ashwin Rao's avatar
Ashwin Rao committed
  for lociter in "uni University" "res Residence"
Ashwin Rao's avatar
Ashwin Rao committed
  do
    set -- $lociter
    loc=$1
    locstr=$2
    fprefix=${loc}-${tech}
    echo ${fprefix}
Ashwin Rao's avatar
Ashwin Rao committed
    sed 's/^/'"${locstr}"'\,'"${techstr}"'\,/'  ${results_folder}/${fprefix}-timestamps.txt >> timestamps.csv
    cat ${results_folder}/${fprefix}-ping.txt | cut -d ' ' -f 7 | grep "time" | cut -d '=' -f 2 > tmp.txt
Ashwin Rao's avatar
Ashwin Rao committed
    sed 's/^/'"${locstr}"'\,'"${techstr}"'\,/' tmp.txt >> ping.csv