import os
import shutil
path='/home/s18ld/dataSet/ntu-rgbd-60/'
newpath='/home/s18ld/dataSet/ntu-rgb-part/PARTthree/'
fileList = os.listdir(path)
print(len(fileList))
for i in range(len(fileList)):#len(fileList)
filename=fileList[i]
#if (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '001'):
#fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4]='001'
#shutil.copyfile(path+filename,newpath+filename)
#os.rename(newpath + fileList[i], newpath + fileList[i][:17] + '005' + '.skeleton')
#print(fileList[i])
if (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '004'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '007'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '023'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '025'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '031'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '033'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '038'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '039'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '040'):
shutil.copyfile(path+filename,newpath+filename)
elif (fileList[i][fileList[i].find('A') + 1:fileList[i].find('A') + 4] == '049'):
shutil.copyfile(path+filename,newpath+filename)
#print(fileList)