PROBLEM

Float values from text files are truncated to whole numbers in ArcMap

Last Published: April 25, 2020

Description

When viewing an ASCII CSV, TXT, or TAB file in an application other than ArcGIS, the file displays values such as:

X,Y
-124,34
-123.45,32.789



When opened in ArcGIS, the values displayed in these items are truncated to:

X,Y
-124,34
-123,32

Cause

Tools that access ASCII files in ArcGIS, such as the 'Add XY Data' command, use a Microsoft driver to read text files. By default, this driver only scans the first 75 records of the text file to determine the data type of each field. If the first 75 records are all integers, then the entire field will be assumed to be integer, even though subsequent records may be float or double.

Solution or Workaround

Modify the schema.ini file, which gets created in the same directory as the text file and defines how the Microsoft driver interprets the text file.

Instructions for modifying this file are available in the ArcGIS Online Help under Contents tab > ArcCatalog > Exploring the values in a table > About tabular data sources > Accessing delimited text file data. A link is provided to a Microsoft Web site where a search can be done on 'schema.ini' to access more detailed information.

  • The following example of schema.ini shows how to force the Microsoft text file driver to read the first 500 lines of a text file called MYDATA.TXT.

    [myData.txt]
    Format=CSVDelimited
    ColNameHeader=True
    MaxScanRows=500

Article ID:000006097

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic