#working code for one file directory = r\'C:\\Users\\Max12\\Desktop\\xml\\pdfminer\\UiPath\\output\' list1 = os.listdir(directory) length = len(list1) print(list1) p