Return to Snippet

Revision: 11674
at February 18, 2009 13:04 by maphew


Updated Code
import arcgisscripting
gp = arcgisscripting.create()
inshape_1 = 'c:/temp/%s' % gp.ValidateTableName('feature1.shp')
inshape_2 = 'c:/temp/%s' % gp.ValidateTableName('feature2.shp')
outshape = 'c:/temp/%s.shp' % gp.ValidateTableName('My-Merge-Output')

print inshape_1
>>> >>> c:/temp/feature1_shp
print inshape_2
>>> >>> c:/temp/feature2_shp
print outshape
>>> >>> c:/temp/My_Merge_Output.shp

# Note; don't use on full path!
print gp.ValidateTableName('c:/temp/My-Merge-Output.shp')
>>> >>> c__temp_My_Merge_Output_shp

Revision: 11673
at February 13, 2009 11:58 by maphew


Initial Code
import arcgisscripting
gp = arcgisscripting.create()
inshape_1 = 'c:/temp/%s' % gp.ValidateTableName('feature1.shp')
inshape_2 = 'c:/temp/%s' % gp.ValidateTableName('feature2.shp')
outshape = 'c:/temp/%s' % gp.ValidateTableName('My-Merge-Output.shp')

print inshape_1
>>> >>> c:/temp/feature1_shp
print inshape_2
>>> >>> c:/temp/feature2_shp
print outshape
>>> >>> c:/temp/My_Merge_Output_shp

# Note; don't use on full path!
print gp.ValidateTableName('c:/temp/My-Merge-Output.shp')
>>> >>> c__temp_My_Merge_Output_shp

Initial URL


Initial Description
courtesy of Luke Pinner @environment.gov.au

Initial Title
sanitize filename, the esri way

Initial Tags


Initial Language
Python