root/mappings/join @ 210
1 |
#!/bin/bash
|
---|---|
2 |
# Joins all *-$1.csv to $1-$2.csv
|
3 |
|
4 |
selfDir="$(dirname -- "$0")" |
5 |
cd "$selfDir" |
6 |
|
7 |
test "$#" -eq 2 || { echo "Usage: $0 from to" >&2; exit 2;} |
8 |
|
9 |
for map in *-$1.*.csv; do |
10 |
type="${map%.*}" # remove extension |
11 |
type="${type#*.}" # remove up to last "." |
12 |
../scripts/util/join <"$map" "$1-$2.$type.csv"|\ |
13 |
../scripts/util/sort 1 0 >"${map/$1/$2}" # sort on output col |
14 |
done
|