I am using the new Split by Attributes tool in 10.5. When I put in a shapefile as input, the outputs are tables only, no shapefiles. It reports in the tool output that shapefiles are being created, but only .dbf files are available in the output workspace.
Any ideas are appreciated.
Solved! Go to Solution.
try moving the file into a geodatabase... it could be the way it treats shapefiles. There is nothing obvious with your code that would make if select the dbase portion.
However... why don't you throw the 'Shape' field into the end of the mix... I am sure it will just return everything... but it will confirm whether dbase of features are returned
Also reverse the order to check
Other than that, examine my code to pull out the portions you need
perhaps you ran it from a table view, rather than selecting the layer in the table of contents, then ensuring you are selecting the layer by name in the tool dialog... if that doesn't work try the old-school Split Layer by attributes since you are working with shapefiles
Hi Dan, I have done a bit more testing. I can run it successfully from ArcMap, but from ArcPy it still only creates tables. Are they different tools on the back end? Any other ideas?
I suspect you are grabbing the table in your script rather than the featureclass.
There is nothing in Split Attributes that has an extra 'toggle'. Your code might reveal whether it is just the table or the featureclass
Thanks Dan, here is the snippet of where I am splitting by attributes. Is there something obvious I am missing below that is selecting the table and not the feature?
import arcpy
import sys
import os
from arcpy import env
#Working folder
wFold = 'C:/Users/Will/Desktop/Testing'
#name of input points
inPts = "ARMs_UTM.shp"
#name of field with unique point names (e.g. ARMsID)
spltFld = "ARMs_numbe"
#Output features folder
ptLoc = 'C:/Users/Will/Desktop/Testing/pts'
#Set workspace
arcpy.env.workspace = wFold
arcpy.SplitByAttributes_analysis (inPts, ptLoc, spltFld)
try moving the file into a geodatabase... it could be the way it treats shapefiles. There is nothing obvious with your code that would make if select the dbase portion.
However... why don't you throw the 'Shape' field into the end of the mix... I am sure it will just return everything... but it will confirm whether dbase of features are returned
Also reverse the order to check
Other than that, examine my code to pull out the portions you need
Great! The answer was to move it into a gdb, thanks for all your help.
Will
Thanks, Dan for your valuable input. I just wanted to clarify your answer a little bit, since I had problems understanding it until my native English speaking coworker explained it to me.
Moving the input file into a geodatabase as a feature class will solve the problem of the output being a dbf file instead of shapefile when the output location is a folder.
Alicia, if the input is a featureclass, the output is a featureclass which could be a shapefile if you are using a folder as a destination rather than a geodatabase.
If the input is a table, the output is a table. following the same logic, if the output location is a folder, then a *.dbf will be output. If a geodatabase is the destination, then a gdb table will be output.
Mind you, I can't test since I haven't used ArcMap in quite some time
Thanks Dan, I was tried running it a few ways, including from ArcPy, and I got the same result. It is definitely the right layer, but it is outputting the features as dbf tables only.
I did some more experimenting, and I think the issue stems from the split field being numerical (long). I created a new column and put a letter at the beginning of each number, and it seemed to work just fine. For now I will add the step of adding some string text at the beginning of each id as a workaround.