From: Rajarshi Chakravarty Date: 2010-08-24T22:41:28+09:00 Subject: Re: Newbie question on file reading Thank you, Robert. The links were most helpful. I need to read char substrings from a file that has no line breaks in it. Is the code below the best way to do it? File.foreach(dataFile) do |line| puts line end Will the "line" var give the entire text in the file? Another question (this is posted on the link you gave) Instead of doing File.foreach(dataFile) can I not do IO.foreach(dataFile) do |line|? -- Posted via http://www.ruby-forum.com/.