From: 7stud -- Date: 2008-01-30T06:23:49+09:00 Subject: Re: newbie file write problem Lars Zeb wrote: > This is my first attempt at ruby. I've written a class (SicCode) which > parses a line and outputs a SQL command. > > I use the following to read an input file and to attempt to write: > > f = File.new("text.txt", "w") > File.open("small.txt").each { > |line| > s = SicCode.new(line).get_sql It sounds like your last line is the problem, so it doesn't have anything to do with writing to a file. You are having trouble retrieving the value for s. -- Posted via http://www.ruby-forum.com/.