- Avoid spaces or any special characters in pathnames. Including spaces in folder names may work, until you run into a script or tool that doesn't handle spaces anywhere in the full path.
- Avoid long pathnames. Try to "flatten" your folder structures so that your system pathnames under 128 characters. It is likely you can go higher but not that much: the absolute Windows pathname limit (MAXPATH) is 260 characters. (This actually makes sense if 256 is the real ancestral limit: 1+2+256+1 or [drive][:\][path][null] = 260)
- Never begin an ArcGIS object name (table, field, relationship class, mxd file, folder, etc) with a number or any other non-alpha character.
The only recommended non alphanumeric to use is "_". Other characters like (" ", "%$.,-", etc) are not advisable.
- Try to avoid names that may conflict with SQL or other language's reserved words. For example: OBJECTID, VALUE, COUNT, NOT, OR, ON, IN, OVER, SELECT. This is to avoid confusing parsers, and people that maintain the code later.
- All field names should contain 10 characters or less. This is a dBase limit, so it applies to .dbf files AND shapefiles. For that reason it's best practice in case you need to go "through" a dbf based format. Coverage and grid names have a limit of 13 characters, but 10 is safer.
- If you choose to use names that do not follow these rules, be warned that you may be causing unnecessary trouble when you try to convert the data to a format or run a tool down the road.
- Raster file names can be particularly problematic. Raster dataset names MUST start with a letter and it is best to keep the filename under 14 characters to support Esri grid format.
- The arcpy methods ValidateFieldName and ValidateTableName can be used at parameter validation time, or in your code, to prevent users of your tool from inserting invalid output names. The CreateScratchName method if provided the proper arguments, will generate valid dataset names.
You have been warned. Violating these suggestions may work, but one thing I have learned in my long career is that one should avoid tempting fate.
- Esri KB 23087: What characters should not be used in ArcGIS for field names and table names?
- Esri KB 40571: FAQ - Does ArcGIS work with objects or user names that contain special characters?
- Esri Bug NIM009116: Path lengths greater than 255 characters does not open in ArcCatalog (ArcGIS 9.2)
- Microsoft Windows DevCenter: Naming Files, Paths, and Namespaces
- Microsoft KB articles
- ArcGIS Desktop help:
- Validating table and field names in Python
- Pathnames explained: Absolute, relative, UNC, and URL
- Fundamentals of adding and deleting fields (subsection: Field naming guidelines)
- Geoprocessing considerations for shapefile output
- Validating Field and Table Names in Python (ArcGIS Pro help, applies to ArcMap arcpy too)
- Contents of a Coverage Workspace
- Naming Files, Paths, and Namespaces - Windows applications | Microsoft Docs
- Best Practices for File Naming (pdf) Smithsonian Institution - aimed at researchers