mirror of
https://github.com/alvierahman90/ssl2csv.git
synced 2024-12-15 02:21:59 +00:00
rewrite so that ssl2csv writes to file
This commit is contained in:
parent
82ff4c9c8d
commit
a45853d5fd
21
ssl2csv
21
ssl2csv
@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
data="$(head -n -1 "$1" | grep 'AD' | cut -d= -f2 | cut -d, -f1)"
|
||||
interval="$(($(head -n -1 "$1" | grep 'Interval' | cut -d= -f2)/10000000))"
|
||||
cumint=0
|
||||
function _ssl2csv {
|
||||
data="$(head -n -1 "$1" | dos2unix | grep 'AD' | cut -d= -f2 | cut -d, -f1)"
|
||||
interval=$(($(head -n -1 "$1" | dos2unix | grep 'Interval' | cut -d= -f2)/10000000))
|
||||
cumint=0
|
||||
|
||||
echo $interval
|
||||
|
||||
for datapoint in $data
|
||||
do
|
||||
echo $datapoint,$cumint
|
||||
cumint=$(($cumint + $interval))
|
||||
done
|
||||
for datapoint in $data
|
||||
do
|
||||
echo $datapoint,$cumint
|
||||
cumint=$(($cumint + $interval))
|
||||
done
|
||||
}
|
||||
_ssl2csv "$1" > "$2"
|
||||
|
Loading…
Reference in New Issue
Block a user