AnsweredAssumed Answered

Batch process multiple ASCII to Raster files

Question asked by tiggs03 on Mar 5, 2012
Latest reply on Sep 26, 2017 by curtvprice
I have multiple (~50) ASCII files that I need to convert to raster. I???m very new to Python but have managed to create a simple script to do this for one file (and it worked- so exciting!). How can I modify this to process ALL of the files? They are all located in the same directory. Any advice would be appreciated. Thanks very much!

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Set local variables
InAsciiFile = "C:/Data/data_2001.asc"
OutRaster = "C:/Data/data_2001"
gp.outputCoordinateSystem = "Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"

# Process: ASCIIToRaster_conversion
gp.ASCIIToRaster_conversion(InAsciiFile, OutRaster, "FLOAT")

Outcomes