vebit-map/prepare.sh

16 lines
509 B
Bash
Raw Normal View History

2019-05-21 23:08:51 +02:00
#!/usr/bin/env sh
2020-04-13 12:36:13 +02:00
if="../non-public/eV/members.fods"
2020-01-30 23:50:27 +01:00
ofn=$(echo $if|rev|cut -d"/" -f1|cut -d"." -f2-|rev)
2019-05-21 23:08:51 +02:00
2019-11-15 22:32:10 +01:00
fae="file already exists."
2019-05-21 23:08:51 +02:00
# recv data
2020-04-13 12:36:13 +02:00
if test -e $ofn".csv" ; then
2019-11-15 22:32:10 +01:00
echo "$fae"
else
2020-01-30 23:50:27 +01:00
libreoffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":"59,,76,3,1/1/2/2/2" $if || { echo "errors during export to csv"; exit 3; }
2020-04-13 13:46:17 +02:00
tail -n +2 ${ofn}".csv" | cut -d";" -f2,13-17|grep -e "^[v|g|n]" > ${ofn}".tmp"
mv ${ofn}".tmp" ${ofn}".csv" || { echo "error on removing first line."; exit 6; }
2019-11-15 22:32:10 +01:00
fi
2019-05-21 23:08:51 +02:00