From: Zoe Phoenix Date: 2008-05-06T19:02:59+09:00 Subject: Re: take text from file and add do it with Ruby..? > Hi Zoe, > Ruby program > ********** > > full= File.open("orig.txt") > phrase=["phrase1","phrase2","phrase3"] > count=0 > full.each do |line| > first=[] > first=line.split(/\|/) > first.each do |single| > sub=single.strip! > main = (sub).to_s + (phrase [count]).to_s > puts main > count+=1 > end > end how can I save the output to a file? I see where you're making it print the output with "main", but when I try to save it to a file the way I have with other programs I've made, I get an error... it says the variable "main" is undefined. Help? -- Posted via http://www.ruby-forum.com/.