From: krzysztof cierpisz Date: 2009-08-19T00:00:10+09:00 Subject: Re: fromdos dos2unix in ruby > > Well, you would read from the input file, replace the dos/windows line > endings with unix ones and write to the output file. > I tried with following dos2unix.rb script ###### dos2unix.rb ###################### out = File.open(ARGV[1],"w") File.open(ARGV[0]).each {|line| out << line.gsub!(/\r$/,'') } out.close ######################################### this: ruby dos2unix.rb u8nl_utf8_tab.dos.txt d works fine on Linux (d with length 408 bytes) but not on Windows, on Windows d is a file with 0 bytes input file u8nl_utf8_tab.dos.txt looks like this: col1,col2|~| "first line of cell 1 second line of cell 1",only line in 2|~| "Czy specjalny telefon przeznaczony dla dzieci w wieku od 3 do 7 lat podbije rynek? Jest prosty, bezpieczny i ma tylko 4 klawisze. Sprzedawać go chce między innymi telefonia ojca Rydzyka. więcej ","Copyright © World Group. Реклама Help Сделать World стартовой"|~| äöüб фыва,"asdf,эжх"|~| thanks, chris