# find pdf files based on IDs in csv file

I have 500 IDs for students in a csv file (I have only one column for IDs) and I need to find the reports (pdf files) for each student among the 2K pdf files. These files are in one folder. Finally, I want to move extracted files into a new folder

So how can I find the pdf file containing the specific ID and move it to a new folder?

I started with this code but got stuck


import fitz
import os
path= r'C:\path\pdf'
id_csv = r"C:\path\pdf\id.csv"
files = os.listdir(path)
with open(id_csv, "r") as i: