按照一个清单拷贝文件到指定目录
A11,A12开始的文件一律补不拷贝,其他正常,什么原因?
import os import fnmatch import pandas as pd import csv import shutil import os.path def find_wav_bylist(csv_path,wav_path,extracted_wav_save_path): csv_file = open(csv_path,'r') csv_reader_lines = csv.reader(csv_file) for row in csv_reader_lines: row_str = "".join(str(x) for x in row) for root, dirnames, wav_filenames in os.walk(wav_path): for wav_filename in fnmatch.filter(wav_filenames, '*.wav'): wav_filename0 = os.path.splitext(wav_filename)[0] #print(row_str.replace(' ','')) if row_str.replace(' ','') == wav_filename0.replace(' ',''): #if row == "A11_88": #print("name found!") #print (row_str) #prin