Robert, I'm pretty new to Ruby so ignore my ignorance.... I have a solution to my problem but wanted to understand more about why my previous appraoch failed (for future reference), in particular, how do I do a simple string substitution of a newline character on Mac OS X, nothing I've tried or that has been suggested has worked. I'll certainly look at REXML, thanks for the help. On May 17, 6:55 pm, Robert Klemme <shortcut... / googlemail.com> wrote: > On 17.05.2007 12:33, Singeo wrote: > > > Hermann, I followed Sebatian's advice to use print instead of puts and > > that solved my problem. But I would still like to understand how to > > remove the newline characters. Here's my code as it currently stands > > (with "rssfile.print line" in place of "rssfile.puts line"), hopefully > > it will help you see how I was trying to tackle the problem. > > Maybe I'm being thick here but I don't understand you: you have a > working solution and an explanation why the NL weren't "removed" > (actually they were removed and then reinserted by using "puts"). Now > what is it that you want to understand about this? > > Another remark: since you seem to be dealing with XML files why don't > you use an XML tool, such as REXML? That's certainly less error prone > when manipulating XML files. > > Regards > > robert