1

This question already has an answer here:

My code will not project and store the feature layer in the scratch.gdb. "ERROR 999999 ... The table name is invalid. The table was not found. [17_5330_51961Lake]"

The interpreter doesn't like "-" characters or beginning or ending in a number. Does anyone know of a work around?

import arcpy
import os

mxd = arcpy.mapping.MapDocument("Current")
mxdpath = mxd.filePath
(filepath, filename) = os.path.split(mxdpath)
MCP_Path = str(filepath)

srl = os.path.join(MCP_Path, r"CoordinateSystems\NAD 1983 UTM Zone 17N.prj")

WBYLID = "17-5330-51961"

WBYLIDlabel = WBYLID.replace("-","_")

LakeOut = os.path.join(MCP_Path + "\OutputData\Scratch.gdb", WBYLIDlabel + "Lake")
arcpy.Project_management(fl, LakeOut, srl)

marked as duplicate by Chris W, PolyGeo Jun 7 '15 at 0:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

From the Defining feature class properties documentation

Additional rules:

  • Names must begin with a letter, not a number or special character such as an asterisk (*) or percent sign (%).
  • Names should not contain spaces. If you have a two-part name for your table or feature class, connect the words with an underscore (_), for example, garbage_routes.
  • Names should not contain reserved words, such as select or add. Consult your DBMS documentation for additional reserved words.
  • The length of feature class and table names depends on the underlying database. The maximum name length for file geodatabase feature classes is 160 characters. Be sure to consult your DBMS documentation for maximum name lengths.
0

Pretty sure this is a limitation of the gdb file type. You could append a text character to the beginning of the output name or output to a folder and shapefiles. You could also try a mdb database as I am pretty sure a number is OK as a name in them. The code might not like appending a number to the string, but it is quoted and contains text so I doubt that's it. Plus your error suggests it is looking for the right file. It probably saved something to the gdb, but renamed it something else. Very helpful that "feature".

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