ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Write Features to Text File

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Writes feature coordinates to a text file.

Legacy:
This tool has been deprecated. For more information, see An overview of the Samples toolbox.

Usage

  • Output from this tool is in the same format as described for the input to the Create Features From Text File tool.

  • Output coordinates are space delimited with the decimal separator of your choice.

  • Outputs with null values for z or m will have the value 1.#QNAN for those positions.

  • Selecting the locale decimal point option will result in the output being separated by whatever the system decimal point is set to. If the system is on a German locale, the output will take the form 1234,5. If the system is on a United States locale, the output will take the form 1234.5

  • Selecting the default Python output option will result in the output being separated by whatever Python is using for a decimal point. This is usually a period.

  • Point features will be output to the following format:

    Point
    id x y z m
    id x y z m
    ...
    END
    
  • Multipoint features will be output to the following format:

    Multipoint
    multipoint_id 0
    pnt_id x y z m
    pnt_id x y z m
    ...
    multipoint_id 0
    pnt_id x y z m
    ...
    END
    
  • Line features will be output to the following format:

    Polyline
    line_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    line_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    END
    
  • Polygon features will be output to the following format:

    Polygon
    polygon_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    InteriorRing
    pnt_id x y z m
    pnt_id x y z m
    ...
    polygon_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    END
    
  • No environment settings affect this tool.

Syntax

arcpy.samples.WriteFeaturesToTextFile(input_features, output_text_file, decimal_separator_character)
ParameterExplanationData Type
input_features

The input features to be written to a text file.

Feature Layer
output_text_file

The output text file.

Text File
decimal_separator_character

The character that will separate the whole number from the decimal.

  • locale decimal point —The system decimal point will be inserted. This is the default.
  • default python output —The default Python separator will be inserted.
  • comma —A comma separator will be inserted.
  • period —A period separator will be inserted.
  • $SEP$ —The $SEP$ string will be inserted.
String

Code sample

# Create geoprocessing dispatch object
import arcgisscripting
gp = arcgisscripting.create()
 
# Set up inputs to tool
inFC= r"C:\temp\routes.txt"
TxtCoords = r"C:\temp\RteCoords.shp"
sep = "locale decimal point"
 
# Run tool
gp.WriteFeaturesToTextFile(inFC, TxtCoords, sep)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal