Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have some txt files that are basically attribute tables (object ID, latitude, longitude, area). In ArcMaps, I have been converting these files into feature classes and saving them in a geodatabase using the following steps:

  • Right click file

    Create Feature Class > From XY Table

    Click on the Coordinate System of Input Coordinates button and then select coordinate system

    Save as File and Personal Geodatabase feature classes and output to selected geodatabase

Since I have a large number of files, I'd like to script this using Python. I don't have a problem iterating throuygh the file folder and getting a list of all files, but which function from the ARC Python library should I use? The is Create Feature Class tool the best one I've been able to find so far, but it created an empty feature class.

i have tried opening the Geoprocessing > results tab while creating the feature class manually, so that I can copy as script, but for these actions I am not seeing any entries in the result pane.

share|improve this question
1  
I think what you're looking for is in resources.arcgis.com/en/help/main/10.2/index.html#/… The tool you have linked to just creates an empty feature class - it doesn't write anything to it. –  Chris W Jun 13 at 19:31

2 Answers 2

up vote 4 down vote accepted

You make no mention that you have any problems reading your text file, so I am assuming that it is just how to get the coordinates into a feature class that has you stumped.

There are a number of ways to do this so some suggestions to start looking at are:

Both have code examples that I think should get you past where you are stuck. I recommend getting the code samples to work first and then try to apply to your situation second.

share|improve this answer

You are going to want to use the make XY event layer and then save the output to file.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000006z000000

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.