Is there an arcgisscripting method for sanitizing a filename to get rid of characters which Arcgis barfs on, the meek hyphen - for example?
|
|
||||
|
|
|
It turns out there is: ValidateTableName_method and here is how one could use it:
One needs to be careful to only process the filename, and not include the path or extension else periods and slashes will be replaced also:
Don't run validate on an input file though. Some experiments showed that a hyphenated filename is legal on input and illegal on output. Also see the related ValidateFieldName_method If you need to process path and filename you might try this (see this ESRI Forum thread):
Thank you Chris Snyder, Conrad J. Wyrzykowski, Luke Pinner, Jason Scheirer, Peter Siebert for contributing to this answer and Matt's education. (ESRI-L) |
||||
|
|
|
A snippet someone gave to me..
|
||||
|
|
|
There is no method for this in arcgisscripting, but you can just use good old Python string manipulation methods to get the job done, such as replace (replace "bad" strings with ""). |
|||
|
|
