Knowledge Base - Technical Articles
Problem: Float values from text files are truncated to whole numbers in ArcMap
| Article ID: | 24611 |
|---|---|
| Bug Id: | N/A |
| Software: | ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 |
| Platforms: | N/A |
Description
When viewing an ASCII CSV, TXT, or TAB file in an application other than ArcGIS, the file displays values such as:
When opened in ArcGIS, the values displayed in these items are truncated to:
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.
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
Created: 3/1/2003
Last Modified: 6/22/2011