I wrote a piece of code in python that converts a raster file to ascii. Now, I need to make it handle possibly all files in the folder. Also, at the end save ascii files with the same name that the original with a suffix added.
I am a total newbee in python and i promise i did my homework, i could just not make the batch processing work on my own. Any help will be so much appreciated!!
import arcpy
from arcpy import env
env.workspace = "C:/Data"
inRaster = ("test.img")
outASCII = "c:/output/test3.asc"
arcpy.RasterToASCII_conversion(inRaster, outASCII)
Try this out:
It gets all the filenames ending in
.imgin the directorydir_nameand passes it to your conversion function.