Storing cvs data for further manipulation using Ruby
- by ischnura
I am dealing with a csv file that has some customer information (email, name, address, amount, [shopping_list: item 1, item 2]).
I would like work with the data and produce some labels for printing... as well as to gather some extra information (total amounts, total items 1...)
My main concern is to find the appropriate structure to store the data in ruby for future manipulation. For now I have thought about the following possibilities:
multidimensional arrays: pretty simple to build, but pretty hard to access the data in a beautiful ruby way.
hashes: having the email as key, and storing the information in different hashes (one hash for name, another hash for address, another hash for shopping list...)
(getting the cvs data in to a Database and working with the data from ruby??)
I would really appreciate your advice and guidance!!