Forum: Ruby Re: Nonlinear scaling - could symbols help solve this?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2a82a5c3ca7d809f687a562c4aea0e18?d=identicon&s=25 Jeremy Hanford (Guest)
on 2006-05-16 15:48
(Received via mailing list)
M. Edward (Ed) Borasky wrote:
> A CSV file is (usually) very much like a database table. And an XML
> document is (usually) a tree. A hash of hashes of arrays is an
> inefficient way to store a tree.
>
> You need an algorithm and a data structure tuned to the algorithm and
> the data. I would recommend starting from the required output and
> working backwards to the input data. Have a look at the Ruby libraries
> devoted to dealing with XML documents, and the Ruby libraries devoted to
> dealing with CSV files. Let the XML libraries build the data structure,
> rather than creating your own.

Thanks for the response.

You are right that my CSV file is very much like a database table (used
to load database tables). However, my XML document is not so tree-like
and actually fits pretty well into a hash of hashes of arrays. I am
looking into the XML libraries - seems like a much neater way of writing
out XML.

Jeremy
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-05-17 05:10
(Received via mailing list)
Jeremy Hanford wrote:
> Thanks for the response.
>
> You are right that my CSV file is very much like a database table (used to load database 
tables). However, my XML document is not so tree-like and actually fits pretty well into a 
hash of hashes of arrays.
A non-tree-like XML document? Are you *required* by the downstream user
to create XML?

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
This topic is locked and can not be replied to.