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?
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?
ASKER
they are all inside a ConcurrentDictionary in vb.net
What is the data structure of the products that are in the dictionary?
ASKER
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?
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?
ASKER
that's correct..
but if it makes things more simple I can make it Concurrent.ConcurrentDicti onary(Of String, String())
and key=123456, value1=shirt, value2=brand and model
but if it makes things more simple I can make it Concurrent.ConcurrentDicti
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.
ASKER
i am okay with what makes things faster..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In what format is the data?
Are you in Visual Basic or C#?