-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataExtraction.sh
44 lines (36 loc) · 2.25 KB
/
dataExtraction.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
rm *.txt
echo "removing files *.txt"
for i in $(seq 1 1 60)
do
echo "start of simulation with ROV period $i"
ns $1 $i>> my_log.txt
grep -Po 'x = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> x$i.txt
grep -Po 'y = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> y$i.txt
grep -Po 'z = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> z$i.txt
grep -io 'applicationROV Throughput[ ]* : [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationROV PER[ ]* : [-0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationCTR Throughput[ ]* : [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationCTR PER[ ]* : [-0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'Sent Packets CTR --> ROV[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Sent Packets ROV --> CTR[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Received Packets ROV --> CTR[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Received Packets CTR --> ROV[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'ROV period[]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -i 'ROV packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'ROV std packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'CTR packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'CTR std packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'adaptive' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'constant' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'opt(send_ack_immediately)' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'slot duration[ ]*: [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'number of nodes[ ]*: [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'CTR round trip time[ ]*: [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
cp ./x$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./y$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./z$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./data$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
rm my_log.txt
echo "end of simulation with ROV period $i"
done