I'm new to python, so bear with me on this one. I want to make a script that searches within all excel files in a specific folder, to see if they contain an '@' sign. If it finds a match it should write to a log.txt files with the name of the excel file. I don't have the name of the excel files in advance.
So far I'm stuck at just read in one file, and return true if it finds the string. What I got is
import pandas as pd
df = pd.read_excel(open('test.xlsx','rb'), sheetname=0)
print(df)
if '@' in df:
print("true")
else:
print("false")
This returns the content of sheet1 in the excel file correctly, but the search to find a match, doesn't seem to work. Any ideas? Maybe Im doing it all wrong.