Data mining question.

newguy

Well-known member
Joined
Jun 30, 2008
Messages
611
Location
Denver Co, USA
Programming Experience
1-3
I have the daunting task to get data out of an Excel file. It starts with ~22000 rows, which I neck down to a stunning 4000+. Since AutoFilter sucks, I loaded a dataset with the file after I converted it to a .csv file. Which is great - I can display the whole thing in a DGV. But my real need is to minus 1 time field in one column from another time field in another column based on a value in another field, and then get the average from these - I know OUCH. What is the best approach for a task like this, LINQ? Query?

Thanks for looking...
 
Last edited:
Ok sure I can iterate thru the datarows and check diff column values and parse the times I need and get the TimeSpan.TotalMinutes after calculating the difference, then getting the average via function I made, so all done...

Also 4000+ datarows and only 128ms to parse, not too shabby...
Was thinking LINQ would have been helpful here, and maybe it would, I will have to look into it further.
 
Last edited:
Anyone have any trouble with time fields being converted to really strange values. I have 2 time fields that are formatted like 12:34:00 PM and they show up like 12/30/1899 12:03. They look normal in the csv file. Any ideas???
 
As it turns out this is the default value that the OLEDB will return if a Date/Time value is missing the date.
 
Back
Top