EDN Admin
Well-known member
Hello,
I am trying to extract multiple zipcodes from a shapefile (using Feature class to feature class tool), but the python shell keeps saying there is error in the name. I have tried to search this error online, cant find any answer.
Hope I can find some help here.
The exact code:
# -*- coding: utf-8 -*-<br/>
# ---------------------------------------------------------------------------<br/>
# sec7_exp.py<br/>
# Created on: 2012-10-30 20:34:32.00000<br/>
# (generated by ArcGIS/ModelBuilder)<br/>
# Description: <br/>
# ---------------------------------------------------------------------------<br/>
<br/>
# Import arcpy module<br/>
import arcpy<br/>
<br/>
# Local variables:<br/>
sfaddr_shp = "C:\Users\neversay\Desktop\GIS112\Lab3\mydata3cyy\automate\sfaddr.shp"<br/>
lab3cyy_gdb = "C:\Users\neversay\Desktop\GIS112\Lab3\mydata3cyy\lab3cyy.gdb"<br/>
<br/>
<br/>
zipList = ("94102", "94103", "94104", "94105")<br/>
for myzip in zipList:<br/>
outfc = myzip<br/>
mysql = "L_ZIP = " + myzip + " OR R_ZIP = " + myzip + ""<br/>
# Process: Feature Class to Feature Class<br/>
arcpy.FeatureClassToFeatureClass_conversion(sfaddr_shp, lab3cyy_gdb, outfc, mysql)<br/>
<br/>
The error:
ExecuteError: ERROR 000361: The name starts with an invalid character<br/>
Failed to execute (FeatureClassToFeatureClass).
Hope someone can help out here.
Thanks!
View the full article
I am trying to extract multiple zipcodes from a shapefile (using Feature class to feature class tool), but the python shell keeps saying there is error in the name. I have tried to search this error online, cant find any answer.
Hope I can find some help here.
The exact code:
# -*- coding: utf-8 -*-<br/>
# ---------------------------------------------------------------------------<br/>
# sec7_exp.py<br/>
# Created on: 2012-10-30 20:34:32.00000<br/>
# (generated by ArcGIS/ModelBuilder)<br/>
# Description: <br/>
# ---------------------------------------------------------------------------<br/>
<br/>
# Import arcpy module<br/>
import arcpy<br/>
<br/>
# Local variables:<br/>
sfaddr_shp = "C:\Users\neversay\Desktop\GIS112\Lab3\mydata3cyy\automate\sfaddr.shp"<br/>
lab3cyy_gdb = "C:\Users\neversay\Desktop\GIS112\Lab3\mydata3cyy\lab3cyy.gdb"<br/>
<br/>
<br/>
zipList = ("94102", "94103", "94104", "94105")<br/>
for myzip in zipList:<br/>
outfc = myzip<br/>
mysql = "L_ZIP = " + myzip + " OR R_ZIP = " + myzip + ""<br/>
# Process: Feature Class to Feature Class<br/>
arcpy.FeatureClassToFeatureClass_conversion(sfaddr_shp, lab3cyy_gdb, outfc, mysql)<br/>
<br/>
The error:
ExecuteError: ERROR 000361: The name starts with an invalid character<br/>
Failed to execute (FeatureClassToFeatureClass).
Hope someone can help out here.
Thanks!
View the full article