Hello, hoping to get some help with collections.
I am parsing a csv and would like to create a collection of rows based on criteria of the first column row value. After looping through all rows my goal is to end up with a few different collections that are holding the data based on the first value of each row.
Basically I am trying to group up the rows into collections of objects.
Should I use table of sequences? I am not sure best approach.
Any help or tips is appreciated.
Thank you kindly :-)
It depends on what are you going to do next.
The main thing that Tables give you over Sequences is fast keyed lookup. This data structure is often called "associative array" and that's what it's for: you can quickly and efficiently find data that is associated with the key that you chose to associate it with. With sequences you need to loop over all the data to find what you need if don't have the index.
On the other hand, if you don't need to look for a specific piece of your data (or you know exactly where it's stored in the sequence) or just will go through all of it anyway, a sequence might be perfectly suitable.
Another heuristic is to use the simplest, most commonly used data structure that fulfills your needs, and go shopping when you clearly see why it's deficient compared to some more specialized one.