project reorganization: 1. executable files in bin directory now. 2. add recursive_unpack_targz.py for recursive unpacking specified in this script archives tar.gz with MVN data. 3. add asotr_unzip_plot.sh bash file for unpacking MVN data, collect asotr data into csv files and plot asotr MVN data. 4. add brd_wheel_1Hz_parser.py for demonstrate how to work with brd telemetry data
This commit is contained in:
30
asotr_csv/data/prepare_csv.sh
Executable file
30
asotr_csv/data/prepare_csv.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#! /bin/bash
|
||||
|
||||
if [ $# != 2 ]
|
||||
then
|
||||
echo "error use $0. Right use this script: "
|
||||
echo "$0 path_to_file data_type (flight or KDI)"
|
||||
echo "example 1: $0 ./data/flight/30_12_2024/ASOTR_1_SOTR_T flight"
|
||||
else
|
||||
data_file=$1
|
||||
data_type=$2
|
||||
|
||||
if [ "$data_type" == "flight" ]
|
||||
then
|
||||
cat ${data_file}.csv | grep -Eo '[0-9]{2}\.[0-9]{2}\.[0-9]{4}' > file1
|
||||
cat ${data_file}.csv | grep -Eo [0-9]{2}:.* > file2
|
||||
|
||||
elif [ "$data_type" == "KDI" ]
|
||||
then
|
||||
cat ${data_file}.csv | grep -Eo [0-9]{2}.[0-9]{2}.[0-9]{4} > file1
|
||||
cat ${data_file}.csv | grep -Eo [0-9]{2}:.* > file2
|
||||
else
|
||||
echo "error argument of data_type: write \"flight\" or \"KDI\" in second argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
paste --delimiter=' ' file1 file2 > file.csv
|
||||
echo "timestamp;ch1;ch2;ch3;ch4;ch5;ch6" > ${data_file}_clear.csv
|
||||
cat file.csv >> ${data_file}_clear.csv
|
||||
rm file1 file2 file.csv
|
||||
fi
|
Reference in New Issue
Block a user