Why is split by attributes different in arcpy than ARCGIS?

1909
5
Jump to solution
04-29-2018 08:22 AM
MarcGillespie1
New Contributor

I am attempting to automate a workflow in python.  If I execute the "split by attributes" tool in AGRGIS, the output is shapefiles (which is what I want).  However, if I "copy as python snippet" from the results window and paste it into a python script...the output is dbf files.  The output is being saved to a gdb.  The output is only a table whether it is saved to a folder or gdb.

The python snippet:

arcpy.SplitByAttributes_analysis(Input_Table="contours", Target_Workspace="C:/temp/data.gdb", Split_Fields="CONTOUR")

Why doesn't arcpy generate shapefiles? 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

ITS a BUG!!!

https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwMzk1NA==

The Split By Attribute script tool only generates table outputs when running in ArcCatalog and a standalone Python script.

Status  not in current production plan

Alternate Solution

Run the tool in ArcMap.

View solution in original post

5 Replies
DanPatterson_Retired
MVP Emeritus

If the input is a featureclass and not a table and the target location is a folder not a geodatabase, do you get dbf's or shapefiles?

0 Kudos
MarcGillespie1
New Contributor

The input is always a shapefile...the output is always a dbf regardless of where it is stored.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Split Layer by Attributes the original... check the code that I used if you are in a pinch.

As for the ArcMap version, ... could be a bug since I don't see anything in the link or the code description that would suggest otherwise.

DanPatterson_Retired
MVP Emeritus

ITS a BUG!!!

https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwMzk1NA==

The Split By Attribute script tool only generates table outputs when running in ArcCatalog and a standalone Python script.

Status  not in current production plan

Alternate Solution

Run the tool in ArcMap.

MarcGillespie1
New Contributor

Thanks Dan!  The documentation needs to change to reflect that the output will always and forever be a table.

0 Kudos