The Glob

I spent part of the day researching how to create and use a listfile within a Python script so that I can run a batch process to convert ASCII XYZ data to ESRI Raster GRIDs. They key is the use of a 'glob'. The glob allows for a user to create a list of specific filies containing a particular extension (or other criteria). In my case it was just creating a list of files that ended with ".txt". Then you can use this to create input and output variables for other functions such as the ASCIItoRaster function in ArcGIS.

In AML (Arc Macro Language) functions already existed (along with examples) of how to do and use this for Arc Workstation. Now that times have changed new processes are needed and are sometimes not so obvious....at least for the semi-need-to-figure-it-out-when-I-have-to programmer. Yes I could just do my processing in AML, but that is 'old school' + who knows when AML will no longer be supported.

No comments: