From: Bill Kelly Date: 2001-12-15T08:36:22+09:00 Subject: [ruby-talk:28554] Re: help with ^M (line endings ) removing From: "Dinakar Desai" > > I have some files that were created in windows. When I use vi editor > the line ending shows as ^M. what is the easiest method to remove them. > Thank you. ruby -i -pe 'gsub(/\015/, "")' somefile I think ought to work (I haven't tested it though!!:) You could combine that with find, ala find -type f -name "*.txt" -exec ruby -i -pe 'gsub(/\015/, "")' {} \; for example to process multiple files. . . Hope this helps, Bill