Last active
June 29, 2021 21:35
-
-
Save nievergeltlab/2d797a1ae138b342782ba84c5222780c to your computer and use it in GitHub Desktop.
Join two files using the join command. Adjust for localization issues that cause improper sorting.
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
LC_ALL=C sort -k1b,1 file1.txt > file1.txt.sorted | |
LC_ALL=C sort -k1b,1 file2.txt > file2.txt.sorted | |
LC_ALL=C join file1.txt.sorted file2.txt.sorted > joined.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment