The Universal Importer allows a user to import data to a form from a file, where the contents of the file is in an unknown format. For example, rainfall data may be supplied to a user as a spreadsheet; the user can import the rainfall data using the Universal Importer by defining the meaning of each column.
The figure below shows the components of the Universal Importer form:
Open (Data File)
Allows the selection of a data file.
Import (Format Template)
Allows a previously saved column definition (.xpuix file) to be reloaded. It is possible to import any XPUIX file however it may not be appropriate for the data being loaded so; the columns in the definition are compared to the column units allowed for the current import. Any invalid column definitions (e.g. a Velocity column is invalid when loading Rainfall) are replaced with a Dummy column, and any invalid columns found are listed on an error form at the end of the import.
Export (Format Template)
Allows the current column definition to be saved to a .xpuix file, so it can be reused.
Number of Header Rows (See 1 on the figure)
Data files may begin with text giving general information and/or column descriptions. The number of header rows entered here are ignored when the data is imported.
Worksheet (See 2 on the figure)
Lists all the available worksheets if the data file is a spreadsheet (.xls or .xlsx). All other worksheets are ignored when the data is imported.
Delimiter (See 3 on the figure)
Allows the column delimiter character to be selected the data file is a text file (.txt or .csv) . Only a single character can be entered.
Data Preview (See 4 on the figure)
A preview of the contents of the file are displayed. Any header rows are shown unformatted, at most, 6 rows of data are show in columns. The columns are either column data from the spreadsheet or the columns formed when the data is split using the delimiter character.
Data Columns (See 5 on the figure)
This shows the data when interpreted by the column units. One or more "?" may be shown if the data cannot be interpreted by the column unit specified. For example, if a column is specified as Date (Month) then any value outside the range 1 to 12 will be shown as "??" in the data column.
The following keyboard and mouse actions can be used on the Data Columns:
Click a column
Select the column, and the corresponding column in the data preview is also highlighted.
|Click and drag a column|
If the drag ends on another column the two columns are swapped.
If the drag ends outside the table the column is removed.
|Left Arrow||Select the column to the left.|
|Ctrl + Left Arrow||Swap the selected column with the column to the left.|
|Right Arrow||Select the column to the right.|
|Ctrl + Right Arrow||Swap the selected column with the column to the right.|
|Remove the selected column.|
|Insert||Insert the column definition selected in (6) to the left of the selected column.|
|Return||Insert the column definition selected in (6) to the end of the table.|
Available Columns (See 6 on the figure)
This lisst the column units that can be added to the Data Columns (5). When a column is added it is removed from the Available Columns, and vice-versa
(columns removed from the Data Columns are returned to the Available Columns).
There is one exception to this action, the Dummy column marks a column as not used. If, for example, the first and third columns contain data to be imported, the second column needs to be marked as Dummy.
The Dummy definition can be used any number of times. Any columns in the preview beyond the last column in Data Columns are assumed to be Dummy. If, for example, the first and third columns contain data to be imported the fourth (and any further columns) are undefined and so are assumed to be Dummy.
The following actions can be used on the available columns:
Click an item
Select the item.
Click and drag an item
If the drag ends at the end of the Data Columns table then selected item is added to the Data Columns table.
If the drag ends on a column of the Data Columns table then selected item is swapped with the column on the Data Columns table.
Add button or Return or double-click an item
Adds the selected item to the end of the Data Columns table.
Insert button or Insert
Inserts the selected item to the right of the selected column.
Swaps the selected item with the selected column.
Remove button or Delete
Removes the selected column.
Select the item above the current item
Select the item below the current item
Keyboard actions are shared between the Data Columns area (5) and the Available Columns area (6) so the keyboard actions detailed for Data Columns may also be used.