in reply to build mysql data structure from text file
Results:#!/usr/bin/perl -w use XML::Simple; use Data::Dumper; $xml = ' <file> <cat1> <sub1> <sub-sub1/> </sub1> </cat1> <cat2/> <cat3> <sub1/> </cat3> </file> '; my $c = XMLin($xml); # substitute filename for $xml here print Dumper($c); __END__
Bob Niederman, http://bob-n.com$VAR1 = { 'cat1' => { 'sub1' => { 'sub-sub1' => {} } }, 'cat2' => {}, 'cat3' => { 'sub1' => {} } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: build mysql data structure from text file
by fireartist (Chaplain) on May 13, 2003 at 22:07 UTC | |
by bobn (Chaplain) on May 14, 2003 at 00:19 UTC |