I have two csv files:test1.csv1234test2.csv6789I want to horizontally merge these two files.  To do this I use paste -d , test1.csv test2.csv > paste.csv  If I open this file in notepad it looks correct i.e.paste.csv1,62,73,84,9However if I load paste.csv in Excel it looks like What I'm I missing?  Thanks in advance!PS This might not matter, but I'm on windows and using Cygwin.UPDATE: When I opened paste.csv in notepad I notice something bizarre.There appears to be an invisible character between the number and comma.  For example, if I put my cursor between 1 and , and the hit backspace, nothing happens.  When I hit backspace again, the 1 is deleted as expected.  If I delete all these invisible characters, and then load paste.csv in excel, it is correct!
Trouble with horizontial merge of csv files under Cygwin
text processing;cygwin;newlines;paste
Unix represents newlines with the character LF (line feed = \n = ^J = 10 decimal = 012 octal = 0x0a hexadecimal). Windows represents newlines with the two-character sequence CR, LF (CR = carriage return = \r = ^M = 13 decimal = 015 octal = 0x0d hexadecimal). When a Windows text file is processed by a Unix utility, each line thus ends with a spurious CR character.Cygwin utilities are straight ports of Linux tools. They don't handle Windows text files specially, so the CR characters do end up as line content. In your pasted file, there's a CR before each comma.You can convert the files to Unix format first:dos2unix *.csvpaste -d , test1.csv test2.csv > paste.csvOr you can just remove the CR characters. Here it works to remove them from inside the line; some other text manipulations would require removing them before processing.paste -d , test1.csv test2.csv | tr -d '\r' > paste.csv