Some data, such as Points of Interest and MasterMap Topography Layer Building Height Attribute, are provided as text files and do not contain feature geometries (Points of Interest contains eastings and northings which can be used to locate the features). When loading these in to ArcGIS it is necessary to create a definition file named schema.ini that specifies the delimiter used in the text file and the data type of each field. This schema.ini definition file ensures that ArcGIS handles the file correctly. Without schema.ini files ArcGIS will automatically assign data types for each field in the file which may not be correct, for example ArcGIS may decide that a date/time field is actually a text field which would prevent any date/time query operations from being run.
Before you can load data from a text file in to ArcGIS you must first create a file called schema.ini in the same directory as the text file you wish to import.
The rules for defining schema.ini files are well documented on the Microsoft Developer Network (MSDN); the basic structure of a schema.ini file is as follows.
[<filename>]
Format=<format>
ColNameHeader=<headerrow>
Col1=<fieldname1> <datatype>
Col2=<fieldname2> <datatype>
Col3=<fieldname3> <datatype>
...
ColX=<fieldnamex> <datatype>
The items above within angled brackets <...> should be replaced as described below:
So, if we have a comma separated text file called example.csv which contains a header row and has three fields for FeatureID (whole number), Area (decimal number) and Name (free text) the schema.ini file would look as follows:
[example.csv]
Format=CSVDelimited
ColNameHeader=True
Col1=FeatureID Long
Col2=Area Double
Col3=Name Text
Note: the schema.ini file must be saved in the same folder as the text file that it refers to.
If you wish to load more than one text file from a single folder then you can add multiple definition blocks to a single schema.ini file as you cannot have two files called schema.ini in the same folder.
Standard schema.ini files created by EDINA for use with the data products downloaded through Digimap are available using the links below:
OS Product | Download |
MasterMap Topography Layer Building Height Attribute | schema.ini |
*Points of Interest | schema.ini |
Having created the schema.ini file and saved it in the same folder as the text file you wish to import, the next step is to add it to ArcGIS using the standard Add Data function. This will add the data as a table in your map document which can be opened by right clicking on it in the table of contents.
Having added the data to your map document it is worth checking that the data types specified in the schema.ini definition file have been correctly used. This is done by right clicking on the file in the table of contents and selecting Properties from the popup menu, then clicking on the Fields tab:
The field names are shown on the left hand side, and the data type which should have been read from the schema.ini file of the field highlighted on the left are shown in the section highlighted on the right hand side in the image above.
Having added the data to ArcGIS you could join it to another dataset using the GIS JOIN operation if the two datasets have a common field.
If the data contains eastings and northings, such as the Points of Interest data you can plot the data as a series of points in your map document.
Further information on schema.ini files can be found on the Microsoft Developer Network.