From 8e23709326348ef03aab65b1ecc615f23220004d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20H=C3=B6ffner?= Date: Fri, 22 Mar 2024 14:23:40 +0100 Subject: [PATCH] add rounded size table output to combine script --- scripts/combine | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/combine b/scripts/combine index bc20c70..def1ae9 100755 --- a/scripts/combine +++ b/scripts/combine @@ -17,6 +17,15 @@ rapper -i turtle -o ntriples hito.ttl > hito.nt echo "hito.ttl and hito.nt contain the HITO ontology, instances and SHACL shapes." printf "all.ttl additionally contains externally referenced resources from DBpedia and the Software Ontology (SWO).\n\n" + +if type awk > /dev/null 2>&1; then + echo "| Filename | bytes | KiB | MiB | KB | MB |" + echo "| -------- | ----- | --- | --- | -- | -- |" + # "command ls" in case it is aliased to eza or something else, we need the exact ls output format + LC_ALL=C command ls -l *.nt *.ttl | awk '{printf("|%11s |%10s |%9s |%9s |%9s |%9s |\n", $9, $5, $5/1024, $5/1024^2, $5/1000, $5/1000^2)}' +fi + +printf "\n## Rounded\n\n" echo "| Filename | triples | bytes | KiB | MiB | KB | MB |" echo "| --------- | ------- | ----- | --- | --- | -- | -- |" # "command ls" in case it is aliased to eza or something else, we need the exact ls output format