simulations: make parser a shell script

This commit is contained in:
Bastian Bloessl
2015-11-30 08:36:09 -08:00
parent 77ed9e84c2
commit 0e11d51b01
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
files=`ls results/*.pcap`
outfile=results/all.csv
rm -f ${outfile}
echo "repetition;encoding;snr;received"
echo "repetition;encoding;snr;received" > ${outfile}
for f in ${files}
do
repetition=`python -c "print \"${f}\".split(\"_\")[1]"`
encoding=`python -c "print \"${f}\".split(\"_\")[2]"`
snr=`python -c "print \"${f}\".split(\"_\")[3]"`
echo "file ${f} repetition ${repetition} encoding ${encoding} snr ${snr}"
rcvd=`tshark -r ${f} | wc -l | tr -d " "`
echo "${repetition};${encoding};${snr};${rcvd}"
echo "${repetition};${encoding};${snr};${rcvd}" >> ${outfile}
done