I am in an unusual position, having two different templates for loading Excel, one of which is "human-friendly" and the other is machine-friendly. Thus, the headers of the data columns are different and difficult to align.
Thus, I would like to refer to column mappings using the ordinal position, rather than the "name" of the column. I currently have this:
var excel = new ExcelQueryFactory(excelFileName); excel.AddMapping<Student>(x => x.FirstName, "First Name"); excel.AddMapping<Student>(x => x.LastName, "Last Name"); excel.AddMapping<Student>(x => x.LastFour, "Last 4 Student ID"); excel.AddMapping<Student>(x => x.LastDate, "Last Date");
and I would like to do something like this:
var excel = new ExcelQueryFactory(excelFileName); excel.AddMapping<Student>(x => x.FirstName, "A"); excel.AddMapping<Student>(x => x.LastName, "C"); excel.AddMapping<Student>(x => x.LastFour, "G"); excel.AddMapping<Student>(x => x.LastDate, "H");
where letters are column links in Excel.
Is there any way to do this?
Bill sempf
source share