#coding=utf-8
import arcpy
import os
def file_name(file_dir):
FileIm_list = []
FileEx_list = []
for root, dirs, files in os.walk(file_dir):
for file in files:
FileIm_list.append(file)
fileSub = file[17:23]
FileEx_list.append(fileSub)
#print(file)
#print(fileSub)
return FileIm_list,FileEx_list
Flist = file_name("[目录]")
#print(len(Flist[0]))
#print(len(Flist[1]))
for i in range(0,len(Flist[0])):
print(i)
print(Flist[0][i])
arcpy.ExtractSubDataset_management("[目录]\\%s"%(Flist[0][i]),
"[目录]\\%s"%(Flist[1][i]),"0")
print("Done")
ExtractSubDataset_management工具介绍
评论