Very new to python,
Trying to bulk process a number of .hdf files,
The problem is the process I'm trying to do won't allow me to add an integer and a string together in the re-naming process.
# Import Modules
import subprocess
import glob
ProcessList = glob.glob('*.hdf')
# Extract sub-datasets
Count = 1
for MODfile in ProcessList:
Outfile = MODfile.replace('.hdf', Count + '_Processed.hdf')
subprocess.call('gdal_translate -of GTIFF -sds ' + MODfile + ' ' + Outfile, shell=True)
Count = (Count + 1)
print("Extracted subdatasets")
Thanks
Try to convert int to string
Outfile = MODfile.replace('.hdf', str(Count) + '_Processed.hdf')