script pour établir une bdd Ãà partir d'un tsv avec différent format - retour accueil
git clone git://bebou.netlib.re/laradb
Log | Files | Refs |
commit f216ecfc88904b8bcf64e84293052b7fb69693fd parent 36a64e6d90d3697ed115e63daee3d5ebb91f655f Auteurice: vi Coloc <vi@coloc.re> Date: Sun, 3 Nov 2024 17:57:48 +0100 last clean avant retour sur bsd Diffstat:
M | src/frise.sh | | | 23 | ++++++++++++----------- |
M | src/utils/date_epoch.sh | | | 3 | --- |
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/frise.sh b/src/frise.sh @@ -3,26 +3,27 @@ # tout passer en unix epoch : # date -j +%s 195509030000 #ccddmmjjHHMM 1955 09 03 00:00 +./src/utils/date_epoch.sh -DIST="../dist" -DB="db.tsv" -epoch_start="../tmp/start_unixepoch" -epoch_end="../tmp/end_unixepoch" +DIST="dist/" +DB="src/db.tsv" +epoch_start="tmp/start_unixepoch" +epoch_end="tmp/end_unixepoch" -max=$( sort ../tmp/end | tail -n1 | grep -o "^.\{4\}" | sed 's/$/ + 1/' | bc ) -min=$( sort ../tmp/start | head -n1 | grep -o "^.\{4\}") +max=$( sort /tmp/end | tail -n1 | grep -o "^.\{4\}" | sed 's/$/ + 1/' | bc ) +min=$( sort /tmp/start | head -n1 | grep -o "^.\{4\}") echo "max = $max : min = $min" # max = 2012 : min = 1971 -min_epoch=$( cut -f1 ../tmp/dateEpoch_final.tsv | sort -g | head -n1) -max_epoch=$( cut -f2 ../tmp/dateEpoch_final.tsv | sort -g | tail -n1) +min_epoch=$( cut -f1 /tmp/dateEpoch_final.tsv | sort -g | head -n1) +max_epoch=$( cut -f2 /tmp/dateEpoch_final.tsv | sort -g | tail -n1) echo "$min_epoch ; $max_epoch " # 41900400 ; 1304200800 entree(){ - echo "$line" | cut -d" " -f $1 | tee $1 + echo "$line" | cut -d" " -f $1 #echo "$line" | tsv-select -f $1 } left(){ @@ -99,7 +100,7 @@ $(LIGNE=1; while IFS= read -r line; do GRAPH LIGNE=$(($LIGNE + 1)) -done < ../tmp/dateEpoch_final.tsv +done < /tmp/dateEpoch_final.tsv ) </table> @@ -108,6 +109,6 @@ done < ../tmp/dateEpoch_final.tsv % cp dist/frise.html ~/coloc.bebou.netlib.re/ -echo "coloc.bebou.netlib.re/frise.html" +echo " firefox coloc.bebou.netlib.re/frise.html" diff --git a/src/utils/date_epoch.sh b/src/utils/date_epoch.sh @@ -27,8 +27,6 @@ s/#/ #/; # make the comments a new field #| once there was a pipe s/^0\{8\}/190001010000/; # for NaN gives a date # for debian date add : s/0000 / /; # in format YYYYMMDD ' -#cut -f1 | -#xargs -n1 date -j +%s } clean 4 > tmp/start clean 5 > tmp/end @@ -44,4 +42,3 @@ tee tmp/end_unixepoch paste -d "\t" tmp/start_unixepoch tmp/end_unixepoch | tee tmp/dateEpoch_final.tsv -