Peter Hickman wrote in post #1120062:
> Given the brevity of the code I have to ask. What have you done to find
> out
> what the problem is yourself?

my out.txt contains as below:

["  <body>\n", "    <p>Hello World!</p>\n", "    <p>Goodbye!</p>\n"]

But I want it to be as :

  <body>
    <p>Hello World!</p>
    <p>Goodbye!</p>

Here is my code:-

need_lines = File.readlines("C:/Documents and Settings/rakshiar/My 
Documents/Downloads/Sample.xml")[1..3]

File.open("C:/Documents and Settings/rakshiar/My 
Documents/Downloads/out.txt", 'w') do |f|
 f.write(need_lines)
end
puts need_lines

-- 
Posted via http://www.ruby-forum.com/.