for i in open('barcod_name.txt','r', encoding="utf-8"):
barcode = file.split('\t')[0]
name = file.split('\t')[1]
path = os.getcwd()+'/results/'+'pdf/'
for root,dirs,files in os.walk(path):
if os.path.splitext(f)[1] =='.pdf':
if os.path.splitext(f)[0].__contains__(name):
if os.path.splitext(f)[0].__contains__(barcode[0:10]) or os.path.splitext(f)[0].__contains__(barcode):
print (os.path.basename(f))
old_filename = os.path.join(root,f)
newfile = barcode+"_"+name +'.pdf'
new_filename = os.path.join(os.path.join(os.getcwd(),'variants'),newfile)
shutil.copy(old_filename,new_filename)