One, the code
[Python]View Plaincopyprint?
- Import arcpy
- Arcpy.env.workspace = "f:\\ndvi\\"
- Rasters = arcpy. Listrasters ("*","grid")
- for Raster inch rasters:
- Rename="re_"+raster
- arcpy. Rename_management (Raster, Rename, "Rasterdataset")
- Print (raster+"---->"+rename)
- Print ("All Done")
Import arcpyarcpy.env.workspace = "f:\\ndvi\\" rasters = arcpy. Listrasters ("*", "grid") for raster in rasters: rename= "re_" +raster arcpy. Rename_management (Raster, Rename, "Rasterdataset") print ( raster+ "---->" +rename) print ("All done")
Ii. description
1. This processing is raster data and can also be used to process vector (shapefiles) and text files ( textfile)
2. Do not change the format of the data;
3. Can only be renamed on the basis of the original data, cannot generate new files.
Third, the operation
ArcGIS Python implements batch raster data renaming