I have some text files with x,y coordinates in them. I created a script that finds the specific .txt files that I want and then puts them in a list. Then it creates corresponding EMPTY feature classes for them. I'm trying to use an insertcursor to populate the empty feature classes with the contents of the text files. However, I'm stuck on this part. Here is the portion of my script that is not working:
# puts the empty feature classes in a list.
fclist = arcpy.ListFeatureClasses()
for fc in fclist:
cursor = arcpy.da.InsertCursor(fc, ["SHAPE@"])
array = arcpy.Array()
#text_Points is the list of the txt files.
for file in text_Points:
desc = arcpy.Describe(file)
desc1 = arcpy.Describe(fc)
if desc.basename == desc1.basename:
for line in fileinput.input(file):
ID, X, Y = string.split(line, " ")
I'm grateful for any pointers. Thanks.