-
Notifications
You must be signed in to change notification settings - Fork 27
Description
This may well be more trouble than it's worth and/or out of scope for the project, but I have a set of spreadsheets I need to pull data from and unfortunately they're not homogeneous in their layout, although they are all in the category of having sheets with a header row and then the rest of the rows in the sheet are for data.
The consumer code that would be nice (but obviously not required, i can always just talk to the underlying gdata directly) would include:
- having
GetTable<dynamic>(sheetname)(orGetTableAsDynamicif it should be a separate method) that used the header row to determine property names (theIDatabaseClientorIDatabasecould expose thepublic Func<string, string> PropertyNameGetter { get; set; }being used for mapping header names to property names in case the user wants to override the default). - having a
GetDataTablethat does similar, but instead of being properties in a dynamic POCO, just uses the normalSystem.Data.DataTable. Optionally, fetch all sheets in spreadsheet as aDataSet.
Similar to how some of the ODBC / Access / ACE / Excel stuff I've used in the past seems to do, it could/should look at the data in each column to figure out the "best" (strongest) type it can use (int, double, string). IIRC the number of rows it would scan to figure out the type for a given column defaulted to 20, but you could configure it as either 0 (all rows) or anything 1 or higher.
Again, this may be way outside the scope of GDataDB, or maybe even better done as a separate project, just wanted to file the issue in case it's something that might end up being a good fit for GDataDB's scope.