summaryrefslogtreecommitdiff
path: root/export_to_csv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'export_to_csv.sh')
-rwxr-xr-xexport_to_csv.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/export_to_csv.sh b/export_to_csv.sh
new file mode 100755
index 0000000..5dd01dc
--- /dev/null
+++ b/export_to_csv.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+rm -f results/results.csv
+
+for file in $(ls results/*.out); do
+ COMPILER=$(echo $file | cut -d / -f 2 | cut -d _ -f 1)
+ RUN_SIZE=$(echo $file | cut -d / -f 2 | cut -d _ -f 2)
+ RUN_PARL=$(echo $file | cut -d / -f 2 | cut -d _ -f 3)
+ RUN_FLAG=$(echo $file | cut -d / -f 2 | cut -d _ -f 4 | cut -d . -f 1)
+
+ # Get each row of result
+ tail -n +4 $file | while read -r line; do
+ CLEANED_DATA=$(echo $line | tr -s ' ', ',')
+ if [ $RUN_SIZE == "short" ]; then
+ echo $COMPILER,$RUN_FLAG,$RUN_PARL,$CLEANED_DATA >> results/results.csv
+ else
+ CLEANED_DATA=$(echo $CLEANED_DATA | awk -F, -v OFS=, '{$1 = $1 ",-1.00000000E+00,-1.00000000E+00";print}')
+ echo $COMPILER,$RUN_FLAG,$RUN_PARL,$CLEANED_DATA >> results/results.csv
+ fi
+ done
+done