Hello,

I have some text files that I would like to extract text from, then join
them on one single line and save them to a text file.

Here is an example of the text I want to take out:

<Title>Protein complexes in Saccharomyces cerevisiae
(GPM06600002310)</Title>
<ShortLabel>GPM06600002310</ShortLabel>
<ProtocolName>None</ProtocolName>

Here is how I would like the text to save as:

Protein complexes in Saccharomyces cerevisiae
(GPM06600002310)GPM06600002310 None


So far I have this:

require 'rexml/document'
include REXML
file = File.new("1.xml")
doc = Document.new(file)
puts doc
aFile = File.new("1.txt", "w")
aFile.write(doc)
aFile.close

I was wondering, how can you split out text and join them on one line?
-- 
Posted via http://www.ruby-forum.com/.