Link to home
Start Free TrialLog in
Avatar of Daniel Sufre
Daniel Sufre

asked on

Organize products into arrays

Hello,
I have a list of over 1,000 products that I would like to read line by line and put each product into an array.
for example all shirts into one array and all shoes into an array.. how can I do this?
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Where does that list comes from?

In what format is the data?

Are you in Visual Basic or C#?
Avatar of Daniel Sufre
Daniel Sufre

ASKER

they are all inside a ConcurrentDictionary in vb.net
Avatar of Fernando Soto
What is the data structure of the products that are in the dictionary?
the key ex: 598659659 then the name like "Shirt Blue Short Sleeves"
So your ConcurrentDictionary object is defined with a key of type integer and a value of type string something like this, ConcurrentDictionary<int, string>, is that correct?

Now the value having a type string with a value like this, "Shirt Blue Short Sleeves", so is the product type ALWAYS the first word in the string?
that's correct..
but if it makes things more simple I can make it Concurrent.ConcurrentDictionary(Of String, String())
and key=123456, value1=shirt, value2=brand and model
No need I just wanted to make sure where the product type was located in the Value string. Seeming that a List of objects is a type safe object would that be better for the collection of products? Seeming that you will be creating the collections at run time as per your statement, "put each product into an array. for example all shirts into one array and all shoes into an array", How will you be identifying each collection? Will you have predefined Array's/List to be filled? Or will you check the first entry and determine what type of list it is or something else.
i am okay with what makes things faster..
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial