diff --git a/scripts/extract_failed_ids.sh b/scripts/extract_failed_ids.sh new file mode 100755 index 0000000..7e53785 --- /dev/null +++ b/scripts/extract_failed_ids.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -e "$1" ]; then + file="$1" +else + echo 'CANNOT FIND LOG FILE' + exit 1 +fi + +if [ -n "$2" ]; then + output="$2" + echo "Outputting IDs to $output" +else + output="failed.txt" +fi + +grep 'Could not download submission' "$file" | awk '{ print $12 }' | rev | cut -c 2- | rev >>"$output" diff --git a/scripts/extract_successful_ids.sh b/scripts/extract_successful_ids.sh new file mode 100755 index 0000000..3b6f7bc --- /dev/null +++ b/scripts/extract_successful_ids.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -e "$1" ]; then + file="$1" +else + echo 'CANNOT FIND LOG FILE' + exit 1 +fi + +if [ -n "$2" ]; then + output="$2" + echo "Outputting IDs to $output" +else + output="successful.txt" +fi + +grep 'Downloaded submission' "$file" | awk '{ print $(NF-2) }' >> "$output"