From: Robert Klemme Date: 2009-03-06T01:43:40+09:00 Subject: Re: add a new line after, w/txtfile thats comma delimited On 05.03.2009 17:06, Mmcolli00 Mom wrote: > Do you know how to attach a string on the end of each value before > splitting into a new line? For instance... > > value1 comments > value2 comments > value3 comments > > I tried this using Robert's code, however, it put the comments on a > newline. > > File.foreach "temp.txt" do |line| > puts "", line.split(/,/),"comments" + @usercomments > end You'd rather choose the variant with gsub for this. robert