Chris Daves wrote:
> Hi,
> I've created a simple program which will read in a file.
> #
> 
> class Reference
> references = 'C:\Documents and Settings\Chris
> Davies\Desktop\References.rb'
> 
> f = File.open(references, 'r')
> file_data = f.read
> f.close
> 
> 
> 
> puts file_data
> end
> #
> 
> but i want to take this file data and interpret each line of data and
> the put each line into a new file line by line.
> 
> cheers

File.open("path/your/file") do |sFile|
  while sLine = sFile.gets
     puts YouCanSeeYourData
  end
end
-- 
Posted via http://www.ruby-forum.com/.