From: 7stud -- Date: 2011-04-29T03:06:53+09:00 Subject: Re: File position and buffers Robert K. wrote in post #995478: > On Wed, Apr 27, 2011 at 10:02 PM, Cee Joe wrote: >> Would I use a do iterator or use a while loop with a gets method? Or >> access again. >> helpful. Thanks! > One of the simplest approaches is to use Ruby's ability to use > arbitrary record delimiters: > > File.foreach file_name, ">" do |chunk| > chunk.chomp! ">" > chunk.gsub! /\r\n?|\n/, '' # remove line terminators > Cee Joe, are you reading the file in binary mode or text mode? -- Posted via http://www.ruby-forum.com/.