| Import or export data |
| See Also |
If an external data file includes the same number of rows as a currently open spreadsheet within GenStat, then the file can be imported as additional columns within this spreadsheet. To do this select the Data file option on the Add submenu from the Spread item on the menu bar and then browse for the file to be imported.
Data can imported directly into GenStat without displaying it within a spreadsheet, To do this select the Data file option on the Load submenu from the Data item on the menu bar and then browse for the file to be imported.
To import data from a text file, except CSV files, the Load ASCII File menu should be used. This menu can be used to open data that is in column format within a text file directly into GenStat with the option of displaying the data in a spreadsheet. To do this select the ASCII file option on the Load submenu from the Data item on the menu bar and enter the relevant options on the menu for loading the data.
Data can be imported from databases using ODBC. To import data using ODBC GenStat provides a wizard that takes you through a step by step process that includes the selection of the table and construction of a simple SQL query. The ODBC Data Query wizard can initiated to import data into a spreadsheet by selecting the ODBC Data Query option on the New submenu of the Spread menu. Alternatively, the wizard can be invoked to load data directly into GenStat by selecting the ODBC Data Query option on the Load submenu of the Data menu.
When data are imported that include column names GenStat validates these. If the column names include any illegal characters these will be changed to ensure that the name is a valid GenStat identifier name. The first character of a GenStat identifier name must be a letter (or '_','%' character) and any others can be either letters, digits or '_','%' characters.
Within the command language data can be imported directly into GenStat using the IMPORT procedure and data can be retrieved from databases using the DBIMPORT procedure.
Data can be exported to databases using ODBC. GenStat can create a new table in the database or you can merge or insert values into existing tables in the database. To export data using ODBC GenStat provides several menus that can be accessed on the Export submenu of the Spread menu bar item.
Within the command language data can be exported from GenStat using the EXPORT procedure and data can be exported to databases using the DBEXPORT procedure.
When data are exported to a spreadsheet application any factor columns will have the '!' character appended to the column name to ensure that the next time the spreadsheet is opened in GenStat it will be opened as a factor.
As well as importing and exporting data to files the Clipboard can be used to transfer data between GenStat and other applications. To help import data using the Clipboard, GenStat provides a menu that contains options for controlling how data are transferred from the Clipboard directly into a GenStat spreadsheet. To invoke this menu select the from Clipboard option on the New submenu of the Spread menu bar item.
When importing data from other formats such as INSTAT, SAS v7-9 and Matlab 5 you will be prompted with dialogs where you can specify additional options as to how the data are to be imported.