I have a CSV list containing paths to 800 TIFF files that I want to add to a mosaic dataset.
So using the Add Rasters to Mosaic Dataset tool, I need to create a loop which changes the input_path variable based on a list derived from the CSV. The CSV paths are formatted as follows -
Looking at the documentation (https://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-rasters-to-mosaic-dataset.htm), I've copied the stand alone script and converted the CSV to a Python list but am lost how to actually link the two together.
import arcpy,os,csv arcpy.env.workspace = 'D:\' md = 'D:\Map.gdb\Mosaic' with open('D:\Mosaic_list.csv') as mosaic_csv: reader = csv.reader(mosaic_csv, delimiter=' ', quotechar='|') mosaic_list = list(reader) print(mosaic_list) for row in mosaic_list: arcpy.AddRastersToMosaicDataset_management(in_mosaic_dataset = md, raster_type = 'Raster Dataset', input_path = row)
The above code results in - ERROR 000732: Input Data: Dataset Path does not exist or is not supported.
Is my approach correct or am I looking at this the wrong way?