Ben Anderson
12/29/2005 11:11:00 PM
yes - there it is. Thanks Bill.
On 12/29/05, Bill Kelly <billk@cts.com> wrote:
> From: "Ben Anderson" <benanderson.us@gmail.com>
> >
> > 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
>
>
>
>