0

How do I execute a script that

  • opens an Excel file
  • searches for a value (there are many in the file so I would like to make a random copy)
  • copies it to pdf / doc and saves
  • goes to the next Excel file and repeats the same operation (all data from Excel must be saved in one pdf / doc.

My Excel file structure:

value

I want to export the data to pdf / doc for which the value is 1.

I started writing the code

import pandas as pd
import numpy as np
file_loc = "location of xlsx file"
df = pd.read_excel(file_loc, na_values=['NA'], usecols = "A:AA")
print(df)
Community
  • 1
  • 1
  • Does this answer your question? [Search entire excel sheet with Pandas for word(s)](https://stackoverflow.com/questions/51657853/search-entire-excel-sheet-with-pandas-for-words) – Joao Vitorino Jan 14 '20 at 00:19

1 Answers1

0

There seem to be a package called python-docx

This might get you started

https://python-docx.readthedocs.io/en/latest/

Supun De Silva
  • 1,437
  • 9
  • 15