I'm using join command under linux, but the results vary between different machines.I have two simple files:cat 1.txt  a aaa,0.2b bbb,0.3c ccc,0.5cat 2.txta aaa,0.2b bbb,0.3c ccc,0.6I'm running the following commandjoin -a 1 -1 1 -2 1 -t , -o 1.1' '1.2' '2.2 <(cat 1.txt| sort -t ,) <(cat 2.txt| sort -t ,) Result on machine 1:,0.2a,0.2,0.3b,0.3,0.6c,0.5join --versionjoin (GNU coreutils) 8.13localeLANG=en_US.UTF-8LANGUAGE=en_US.UTF-8LC_CTYPE=en_US.UTF-8LC_NUMERIC=en_US.UTF-8LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8LC_PAPER=en_US.UTF-8LC_NAME=en_US.UTF-8LC_ADDRESS=en_US.UTF-8LC_TELEPHONE=en_US.UTF-8LC_MEASUREMENT=en_US.UTF-8LC_IDENTIFICATION=en_US.UTF-8LC_ALL=en_US.UTF-8Result on machine 2:a aaa,0.2,0.2b bbb,0.3,0.3c ccc,0.5,0.6join --versionjoin (GNU coreutils) 5.97localeLANG=en_US.UTF-8LC_CTYPE=en_US.UTF-8LC_NUMERIC=en_US.UTF-8LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8LC_PAPER=en_US.UTF-8LC_NAME=en_US.UTF-8LC_ADDRESS=en_US.UTF-8LC_TELEPHONE=en_US.UTF-8LC_MEASUREMENT=en_US.UTF-8LC_IDENTIFICATION=en_US.UTF-8LC_ALL=Clearly, the result on the first machine is wrong. It's been truncated. I've tried to use different locale settings but had no success.
Truncated result returned by JOIN
linux;text processing;join
Fix your files with dos2unix, or if that's not installed:sed -i 's/\r$//' {1,2}.txt 