In ArcGIS Pro, you can access data in delimited text files and work with them as tables. The Catalog pane and the Add Data dialog box list files with .txt, .asc, .csv, or .tab extensions and assign them a file type of text file.
Files with a .txt, .asc, .csv extension are interpreted as comma delimited, while files with a .tab extension are interpreted as tab delimited by default. Any file with one of these extensions is interpreted as a text file table even if it doesn't contain tabular data. If you try to display a text file that doesn't contain tabular data, the data is displayed as a table if possible, or an error occurs. To avoid the error, ensure that delimited text files have a .csv or .tab extension to differentiate text files with delimited data from unformatted text files.
The first row of a text file can contain the column headings, and the subsequent rows can contain coordinates and attributes. Use commas or tabs to delineate the columns. The following is an example of a comma-delimited text file:
x,y,ID,color 8.6,5.6,001,blue 99.3,77.0,002,blue and red 8.01,44.3,003,orange
How coordinate information is determined
If a delimited text file contains data coordinate information, such as x,y data, ArcGIS Pro recognizes the coordinate information as numeric fields that can be used to display your information either as a layer or as input to tasks, such as geocoding. In the example above, the coordinate information was straightforward and easy to recognize, contained in fields x and y.
Sometimes the information you need is stored in a different format or naming convention. For example, if the coordinate information is stored in a text field in degrees, minutes, and seconds (for example, -120 13 58), it is converted and displayed in decimal degrees.
In the case of single-field formats, such as UTM, the original UTM field is maintained, and two fields are added, appended with _X and _Y and display the coordinate information in decimal degrees. For example, when you open a text field called UTM, there are three fields: UTM, UTM_X, and UTM_Y.
In the case of double-field text fields, such as latitude and longitude, the original fields are maintained along with two new fields to contain the converted decimal degree coordinate information. For example, when you open a text file with two text fields called Lat and Lon, two fields are added: Lat_D and Lon_D. The numeric information stored is supported in text files in many different formats. See Supported notation formats for a list of these formats, including a detailed description of the supported notation.
To display the contents of the text file in a format other than decimal degrees, use the Convert Coordinate Notation tool to convert the coordinate information.
Field names for ASCII and text files follow the same conventions as field names for geodatabase feature classes. See the Field names section in Define fields in tables.
The only character that is not supported is a single double quote. You must edit the field names in delimited text files to remove any single double quotes and either remove them or replace them with another character.
Override how text files are formatted
When implementing delimited text file information to display in ArcGIS Pro, the most common cases for displaying text files are supported. The settings specified in a schema information file (schema.ini), which are used by the Microsoft ODBC Text driver for storing data description information, are honored and help determine how the text file should be displayed. In previous releases, schema.ini files, were not required for displaying delimited text file information.
A schema.ini file is created automatically when you open a delimited text file that contains a field that cannot reliably be determined. It presumes the format of that field. If the information in delimited text files displays correctly, you can leave the schema.ini file. If the field type is misinterpreted, you can use the schema.ini file to override how the information is displayed. Remove or rename the schema.ini file to test how the information in the delimited text file is handled.
The following example shows how to modify a schema.ini file to override the default behavior. In this case, the PLOTS field should be displayed as type Text but is interpreted as type Double.
[Trees.CSV] Col14=PLOTS Text
You must create a schema.ini file if one is not present to override how the files are displayed. For more information about the schema.ini file, search for schema.ini on the Microsoft MSDN website.
When considering editing a schema.ini file, keep the following in mind:
- If attribute values are bracketed with special characters such as double quotes, the fields are interpreted as text fields. For numeric fields, make sure that the double quotes are removed.
- If you do not want to update the
schema.ini file but want to keep all the data as a float field,
ensure that the first line of data has a decimal (.) in it and all
other features remain as float. For example, set up the text
file as follows:
ID Name Number 1 One 1.0 2 Two 2.4564 3 Three 3.45464