From: "Jesús Gabriel y Galán" Date: 2009-09-18T04:01:32+09:00 Subject: Re: Value isn't appended in puts statement(appears on next line) On Thu, Sep 17, 2009 at 8:51 PM, Mrmaster Mrmaster wrote: > Hello, > > I have a small script which reads each line from a txt file and appends > it to the puts statement. My problem is that the last single quotation > mark appears on a new line. How would I make it appear on the same line. > I have am completely lost and would appreciate the help. Thanks > > File.open("directory") do |file| >        while somedigit = file.gets p somedigit >                puts "SQL STATEMENT I MADE UP ='"+somedigit+"'" >        end > end I think this will give you a clue on what's going on, and how to move on: File.open("directory") do |file| while somedigit = file.gets somedigit.chomp! puts "SQL STATEMENT I MADE UP ='"+somedigit+"'" end end In summary, gets returns the \n at the end of the line, so you should remove it. Hope this helps, Jesus.