Peter Bailey wrote:
> Thanks, Jan. My data originally came from a mainframe ASCII export, so, 
> it looks like a 2D table, delineated with spacebands. I've tweaked it 
> now so it's just using tabs, and I've even imported it into a 
> spreadsheet. I guess it's much more like a CSV format now than a YAML 
> format.
>
> I have one question to your response. You say that I could store the 
> data in a hash keyed by a filename, which I have done in the past, but, 
> then you say that the rest of the columns, of which there are many, 
> could be the key's value. How can you have multiple entries for a key 
> value? A hash is only a "2-column" entity, isn't it, one key, one value? 
> Do I just make all the cells in a row one value, with a comma or 
> something between them as a way to distinguish each cell? In other 
> words, use the has to match the incoming filename, then, make the row 
> that it's in an array and take it from there? (I'm thinking out loud 
> here.)
>   
If you don't mind installing an additional library, take a look at 
KirbyBase (http://netpromi.com/kirbybase_ruby.html).  If you have 
imported your file into a spreadsheet, then you can do a csv export from 
the spreadsheet to get a csv file.  KirbyBase will allow you to import 
this csv file and, bingo, you now have a KirbyBase table.  You can 
easily do searches against the table to find records with filenames 
matching your incoming file.  Additionally, the record is returned to 
you as a Struct object, so you can easily access the other fields.

HTH,

Jamey Cribbs

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.