How to import data from excel xlsx files to sql database if in some files the row and content of the headers are changing (even if they change they point the same data, see example)? I work in Visual basic environment with VS 2012
Here is the example:

The problem is number of headers are changing from file to file. I planned to use an "Aliases" table in SQL (above on the right I showed a sample of Aliases table) which will store the alises used for the same header name for e.g. in first table "education level" is written as column header in second file "edulvl" but they all point to the same data "education level" so they all should be recorded in DB as alises of "education_level" fieldname.
In short: Files can be either xls or xlsx columns are changing position and name (alias) from file to file Place of data (together with columns) change position from file to file Number of columns change
Simple Algorithm of the code:
Thanks in advance!
Here is the example:


The problem is number of headers are changing from file to file. I planned to use an "Aliases" table in SQL (above on the right I showed a sample of Aliases table) which will store the alises used for the same header name for e.g. in first table "education level" is written as column header in second file "edulvl" but they all point to the same data "education level" so they all should be recorded in DB as alises of "education_level" fieldname.
In short: Files can be either xls or xlsx columns are changing position and name (alias) from file to file Place of data (together with columns) change position from file to file Number of columns change
Simple Algorithm of the code:
- user inputs through fileDialog fulladdress of file then clicks
- import program checks whether it is xls or xlsx file program
- opens the file
- finds location of data
- reads column names
- searches them in Aliases DB table
- if nothing matches,
- asks for user input to decide if it is an alias of a field or a new field
- if mathches with an earlier input in aliases table in DB finds out the field name in "Project Table" in DB using Aliases table.
- When reading is completed New fields are created in "project table" and in "aliases" table new entries are made
- using the information gathered from xl file the data is positioned and mapped so the data import process is started
Thanks in advance!