Utils: 1-column-statistics added, which includes awk scripts that calculate min,...
[p2p-testing-infrastructure.git] / Utils / 1-column-statistics / min
diff --git a/Utils/1-column-statistics/min b/Utils/1-column-statistics/min
new file mode 100755 (executable)
index 0000000..100df4d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/awk -f
+# Calculates the minumum value of 1 column.
+
+BEGIN  {
+       min = -log(0)
+       FS = "[ \t]+"
+}
+
+/^[0-9]+/ {
+       if($1 < min)
+               min = $1
+}
+
+END    {
+       printf "%f\n", min
+}