akonsu wrote:
> hello,
> 
> 1. what should happen if the files have different structure (different
> set of sections/subsections)?
> 
> 2. please define "data", "magically merged together", "range".

Thanks for the responses guys... Here's a little more info based on 
them.

The sections and subsections and data are defined by {} and [] and 
values... for example.

DataGroup = {
     [1] = {
           [1] = {
                 ["dataidentifier"] = {
                        [1] = {
                              ["type"] = 1,
                              ["x"] = 45.5,
                              ["count"] = 1,
                              ["image"] = 4,
                              ["y"] = 18.8,
                          },
                        [1] = {
                              ["type"] = 1,
                              ["x"] = 21.5,
                              ["count"] = 5,
                              ["image"] = 4,
                              ["y"] = 31.8,
                          },
             },
           [2] = {
                 ["dataidentifier2"] = {
                        [1] = {
                              ["type"] = 1,
                              ["x"] = 74.5,
                              ["count"] = 1,
                              ["image"] = 3,
                              ["y"] = 11.8,
                          },
                        [1] = {
                              ["type"] = 1,
                              ["x"] = 27.5,
                              ["count"] = 5,
                              ["image"] = 3,
                              ["y"] = 36.8,
                          },
             },
-----------------

Disregard the last piece of my post when I said I wanted to merge data 
within a range. After reviewing what I want to do, this is no longer the 
case.  I only want to merge data if the value is the same.

take for example the "x" and "y" values above... For the first section 
where there is "dataidentifier", both of my files have that section... I 
want that if the "x" and "y" values are the same then to just add the 
values under "count" If the "x" and "y" values are different then I just 
need to have the resulting file showing the section with each of the 
dataidentifier data for each of the x and y.  Obviously these "x" and 
"y" values are coordinates.

Maybe if I explain where I'm coming from it will make more sense. Say 
I'm looking for widgets at x and y, and I need to record how many I find 
and where.

Scenario 1.
I find 2 of the widgets at 15,18. That gets recorded into file 1.
I find 1 of the widgets at the same location, 15,18 These get recorded 
into file 2.

Scenario 2.
I find 2 widgets at location 21,30. This goes into File 1
I find 2 contraptions at location 10,23. This goes into File 1
I find 3 widgets at location 13,40. This goes into File 2

On scenario 1, I want the resulting file to show that I found a total of 
3 items at location 15,18.

On scenario 2, I want the resulting file to show that I found 2 widgets 
at location 21,30, 3 widgets at location 13,40 and 2 contraptions at 
location 10,23.

Is what I want to do better explained now? There is obviously the 
complication (I think) of the coordinates having decimal points.  I 
can't aovid this.  I also can't avoid writing the 2 files, this is why I 
am working on this. I know it would be ideal to have just a single data 
file where everything gets written to but this is beyond my control for 
this project...

I really appreciate how fast you guys replied and I hope I'm helping you 
help me. :)

-- 
Posted via http://www.ruby-forum.com/.