Mercurial > repos > climate > eodie
diff postprocess_csv.sh @ 0:81b0ca76435d draft default tip
"planemo upload for repository https://gitlab.com/eetun-tiimi/EODIE commit c4a5672398bc878dd2bc0bf4f3a26f59b3f6395c"
author | climate |
---|---|
date | Thu, 30 Dec 2021 15:24:09 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/postprocess_csv.sh Thu Dec 30 15:24:09 2021 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +WORKDIR=$1 +RESDIR=$2 + +echo "====================================================================" +echo " Convert EODIE csv to tabular " +echo "====================================================================" + +nb_csv=$(find $WORKDIR -type f -name "*.csv" | wc -l) +echo "Number of csv file to convert: $nb_csv" +if [[ $nb_csv -gt 0 ]]; then + echo "Start" + for infile in $WORKDIR/*.csv; do + echo "processing $infile" + sed -i.bak -e "s/,/\t/g" $infile + mv $infile $RESDIR/. + done +fi + +echo "EODIE Tabular saved."