I'm trying to extract some zip files and after extractions reading only specific CSV files from this folder, there is one pattern but I couldnt place the code. The pattern is Im looking numeric name file, here is my code.
import glob
import pandas as pd
import zipfile
from os import listdir
from os.path import isfile, join
path = r'C:\Users\han\Desktop\Selenium'
all_files = glob.glob(path + "/*.zip")
li = []
for filename in all_files:
with zipfile.ZipFile(filename, 'r') as zip_ref:
zip_ref.extractall(r'C:\Users\han\Desktop\Selenium')
detail = [f for f in listdir(r'C:\Users\han\Desktop\Selenium\detail') if isfile(join(r'C:\Users\han.37\Desktop\Selenium\detail', f))]
After this point, my detail list is like this
['119218.csv',
'119218_coaching.csv',
'119218_coaching_comment.csv',
'119218_emp_monitor.csv',
'119218_monitor_work_time.csv',
'119218_reponse_text.csv',
'119218_response.csv',
'119219.csv',
]
What I want is that reading only numeric ones which are 119218 and 119219 .csv. and ofc pd.concat
because they are same shaped data tables.
Thanks in advance