<?xml version="1.0" encoding="windows-1252"?>
<node id="6718" title="How do I split a file into separate sections?" created="2000-04-03 12:34:15" updated="2005-08-15 08:07:52">
<type id="1857">
categorized question</type>
<author id="11732">
QandAEditors</author>
<data>
<field name="doctext">
I have a text file that is composed of sections each with the same headers;
e.g.;
&lt;code&gt;
TI: some lines
AU: some lines
JN: some lines
&lt;/code&gt;
The section is then repeated for a number of "hits"
What I want to do is grab each section and place it into a hash with the section headers as keys.
any ideas?
P.S. I'd rather not use the split function</field>
<field name="parent_node">
1835</field>
<field name="reputation">
3</field>
</data>
</node>
