Skip to content

Commit 4d9dab5

Browse files
add rounded size table output to combine script
1 parent 734b69d commit 4d9dab5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/combine

+13-4
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@ rapper -i turtle -o ntriples hito.ttl > hito.nt
1717

1818
echo "hito.ttl and hito.nt contain the HITO ontology, instances and SHACL shapes."
1919
printf "all.ttl additionally contains externally referenced resources from DBpedia and the Software Ontology (SWO).\n\n"
20+
21+
if type awk > /dev/null 2>&1; then
22+
echo "| Filename | bytes | KiB | MiB | KB | MB |"
23+
echo "| -------- | ----- | --- | --- | -- | -- |"
24+
# "command ls" in case it is aliased to eza or something else, we need the exact ls output format
25+
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)}'
26+
fi
27+
28+
printf "\n## Rounded\n\n"
2029
echo "| Filename | triples | bytes | KiB | MiB | KB | MB |"
2130
echo "| --------- | ------- | ----- | --- | --- | -- | -- |"
2231
# "command ls" in case it is aliased to eza or something else, we need the exact ls output format
2332
command ls -l *.nt *.ttl | tr -s ' ' | cut -f5,9 -d ' ' | while read -r size filename; do
2433
triples=$(rapper -i turtle -c "$filename" 2>&1 | grep -o "[0-9]*")
25-
kib=$((size / 1000))
26-
mib=$((size / 1000000))
27-
kb=$((size / 1024))
28-
mb=$((size / 1024 / 1024))
34+
kb=$((size / 1000))
35+
mb=$((size / 1000000))
36+
kib=$((size / 1024))
37+
mib=$((size / 1024 / 1024))
2938
#echo "$size $filename"
3039
printf "| %11s | %11s | %12s | %9s | %7s | %9s |%7s |\n" $filename $triples $size $kib $mib $kb $mb
3140
done

0 commit comments

Comments
 (0)