From: "Bartosz DziewoƄski" Date: 2012-06-28T06:35:38+09:00 Subject: Re: CSV.open problem, help please 2012/6/27 Jan E. : > Ryan Davis wrote in post #1066410: >> "Windoze new lines are stupid" is the simplest I can make it. But you're >> right, pointing you towards something to read/learn about probably >> complicated things a bit much. > > OK, it seems Ryan doesn't know the reason either. > > Does anyone else know what's going on here? Is it a bug? Is it a problem > of Ruby or of the CSV parser? Windows uses \r\n for newlines. Linux uses \n. Ruby's CSV apparently doesn't support \r\n, only \n. Opening files in "r" mode performs some conversion on the input, for example encoding conversion or *drum roll* newline conversion. "rb" (binary) mode suppresses them and yields precisely the same bytes as present in the file. -- Matma Rex