diff --git a/combiner.sh b/combiner.sh new file mode 100644 index 0000000..a255058 --- /dev/null +++ b/combiner.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +mkdir -p combined-datasets +for area in $(find processed-datasets/ -type f -printf '%f\n' | sort -u); do + ( + echo '{' + first=1 + for dataset in $(find processed-datasets/ -name "$area"); do + if [[ $first -eq 1 ]]; then + first=0 + else + echo "," + fi + echo -n '"'$(basename $(dirname $dataset))'":' + cat $dataset + done + echo + echo '}' + ) > combined-datasets/$area +done