From: Ben Anderson Date: 2005-12-30T08:10:56+09:00 Subject: Re: create file with LF (not CRLF) in windows yes - there it is. Thanks Bill. On 12/29/05, Bill Kelly wrote: > From: "Ben Anderson" > > > > I have a bunch of files that I want to convert from CRLF to just LF. > > How might I do this? I'm testing with the following example file > > (steel.rb): > > > > f = File.new("steel", "w") > > f.syswrite("steel\ncity"); > > f.close > > Try in "binary" mode. > > f = File.new("steel", "wb") > > BTW, if you use blocks, you can omit the f.close: > > File.new("steel", "wb") do |f| > f.print("steel\ncity") > end > > > (See also IO#binmode ) > > > Regards, > > Bill > > > >