How can I make a script to search information in a spreadsheet?

Hi! I am semi comfortable with using python. Currently I am trying to make a script to search for information in a spreadsheet. Column A and B need to be combined into a query, and then searched with the rest of the column headers. Think of google dorking!

I already have ten APIs and ten CSE ids but I am just unsure of what is the best way to approach this. I have tried to use ChatGPT and Gemini to help in both using excel and google scripts but I keep having issues with the code printing out the results correctly. Any help or direction will be appreciated. Thanks!

In my opinion, the simplest one would be to use pandas.read_excel and do the rest with pandas.DataFrame that is returned.

Why use Python when there are utilities to do this in a .csv file.

Use grep in linux or findstr in Windows cmd.exe.

Ex: findstr /i /n findthis file.csv

I guess you may want a command-line version run by python to search an actual Excel file for some other purpose as well.

Also, avoid using AI to get snippets of programming code. They often omit best practices or show just plain old code that no longer works, or shows code with modules that don’t work with a recent Python version.

Instead I do a search with a search engine where I can show only results from the past year. I have much better results from that.