Jan-10-2022, 10:43 AM
with open('Output.csv', 'w') as pdf: pdf.write('{0},{1}\n'.format("Page Number", "Search Word")) pages = pdf.pages for page_nr, pg in enumerate(pages, 1): content = pg.extract_text() if search_word in content: print(f'<{search_word}> found at page number <{page_nr}> '\ f'at index <{content.index(search_word)}>')If I can still ask, I'm trying to print these results now in CSV format with values. I'm still trying to understand and learning about syntax in python.
Would really appreciate your help. Thanks.