# Re: Nonlinear scaling - could symbols help solve this?

**URL:** <https://www.ruby-forum.com/t/re-nonlinear-scaling-could-symbols-help-solve-this/94847>\
**Category:** Ruby\
**Created:** [May 16, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/re-nonlinear-scaling-could-symbols-help-solve-this/94847 "2006-05-16T15:48:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyheiler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Post date:** [May 16, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/re-nonlinear-scaling-could-symbols-help-solve-this/94847/1 "2006-05-16T15:48:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeremyheiler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Post date:** [May 17, 2006, 5:10am UTC](https://www.ruby-forum.com/t/re-nonlinear-scaling-could-symbols-help-solve-this/94847/2 "2006-05-17T05:10:07Z")

</div>

Jeremy H. 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://www.linuxcapacityplanning.com/)**
>
> 世界杯竞猜彩票一直以来遵守商业道德，世界杯官网竞猜坚持诚信为本，保证诚实经营。世界杯竞猜彩票先后成为安徽省电子商务协会理事单位、安徽省网商协会会员单位、合肥市电子商务协会理事单位、合肥市服务外包行业协会会员单位、安徽省云计算产业促进会会员单位。世界杯官网竞猜一直保持良好的技术及服务态度，更好地为客户服务。
