I need a little help to manage more branch in a data Tree.
for this case, I have lists with Date Time for each data Branch, but I need to see if among all the branches there are the exact minutage and know which Branch has the same minutage. Any suggests?
Maybe not, this is a variant that I had already tried, why so I need to enter manually the date to search. I had something to automate the whole thing.
That’s an elementary LINQ task (real-time no matter how big the DataSet is: this means a few milliseconds for doing the List and extract any type of stuff via some query - you don’t even need PLINQ for that [P for parallel]).
Step 1. Define a custom type class and sample your data in a List of that type. The 5 minute code for that is :
Step 2. Then you just need a LINQ line of code per query (any imaginable search: like find days that are in some Time Interval, find Months that have this time Interval, find cats, find dogs … blah, blah). Since the class Properties include the Path and the Index … well … you can guess that the pos in the DataTree is the easiest thing to retrieve
So if you are interested for that type of solution I could add some Lines more for some demo queries (results in real-time etc).The classic way to do it is like that (where the searchMin/Max define the search Interval).
Of course you can run any imaginable nested query as well.
dear @Pavel2, dear @kev.r , thanks for the help, very very appreciate. This is almost the solution.
@kev.r It would be perfect, to split each shared Date time into a separate branch, like in pavel’s script, but have it sort in time order, like in your script. If it’s not possible, it’s still not a great problem.
Anyway after sorting the chaos … do the following:
Provide a data validation pre check.
Provide query options (i.e. do this or that etc etc) and primary/secondary/… search Intervals (for multi nested queries as is the norm in real-life). If searchMin iis > than searchMax use a Swap Method. Uae public vars for the search in order to avoid calling locomotive long Methods.
Replace any native component with code.
Practice GroupBy and THEN OrderBy (in a flat or nested LINQ - multi nested queries is the essence of data mining in Engineering).
Exploit PlanB (PLINQ) - but don’t expect big things.
Exploit PlanC: a thread safe // approach.
BTW: Building the DT List takes about 15 to 70 ms (the latter using an ancient I5 [ on purpose]) … so 500 more for the LINQ part is way toooooo much (*). For that type of queries (i.e. not calling some heavy Method(s)) and for ~100K values one should expect 100 ms in total.