I have a bash question (when using
awk
cut -f4 test170201.rawtxt | awk '/stream_0/ { print $1, $5 }' > testLogFile.txt
Timestamp
Loss
Timestamp Stream Status Seq Loss Bytes Delay
17/02/01.10:58:25.212577 stream_0 OK 80281 0 1000 38473
17/02/01.10:58:25.213401 stream_0 OK 80282 0 1000 38472
17/02/01.10:58:25.215560 stream_0 OK 80283 0 1000 38473
17/02/01.10:58:25.216645 stream_0 OK 80284 0 1000 38472
17/02/01.10:58:25.212577 0
17/02/01.10:58:25.213401 0
17/02/01.10:58:25.215560 0
17/02/01.10:58:25.216645 0
"/"
":"
"."
170201 105825 212577 0
170201 105825 213401 0
170201 105825 215560 0
170201 105825 216645 0
You can use the awk gsub()
(global substitute) function to:
.
with space:
and /
cut -f4 test170201.rawtxt | awk '/stream_0/ {
gsub(/\./," ",$1)
gsub(/[:\/]/, "", $1)
print $1, $5
}'
In fact, the cut
seems to be redundant - this will do what you require with the example data:
awk '/stream_0/ {
gsub(/\./," ",$1)
gsub(/[:\/]/, "", $1)
print $1 , $5
}' test170201.rawtxt