Last active
February 3, 2017 17:37
-
-
Save keuv-grvl/dbbf66e58555652c63ed73b3d22c425e to your computer and use it in GitHub Desktop.
Join multiple files by their first columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: join_rec file1.tsv file2.tsv file3.tsv file*.tsv | |
# do not try to join 23k files... | |
function join_rec { | |
f1=$1; f2=$2; | |
shift 2; | |
if [ $# -gt 0 ]; then | |
join -a1 -a2 -e 0 -o auto -t$'\t' "$f1" "$f2" | join_rec - "$@" ; | |
else | |
join -a1 -a2 -e 0 -o auto -t$'\t' "$f1" "$f2" ; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment