From: "Jan E." Date: 2012-03-29T06:25:38+09:00 Subject: Re: copy file into new without dups, eol problem Hi, Ruby uses the LF character ("\n") for line endings, while Windows uses the CR LF combination ("\r\n"). It seems you have to open the file in binary mode so that the CR LF don't get converted into LF: File.open 'C:/htdocs/new.txt', 'wb+' do |file| lines = File.open('C:/htdocs/old.txt', 'rb', &:readlines).uniq file.print *lines end Yeah, this *is* ugly. I wonder why Ruby cannot handle that itself. -- Posted via http://www.ruby-forum.com/.