This is my current code:
folder_path1 = os.chdir("C:/Users/xx/Documents/xxx/Test python dict")
words= set()
extracted = set()
for file in os.listdir(folder_path1):
if file.endswith(".xlsx"):
wb = load_workbook(file, data_only=True)
ws = wb.active
words.add(str(ws['A1'].value))
wordsextract = re.match(r"(.*)\((.*)\)", str(words))
extracted.add(str(wordsextract))
print(extracted)
I'm not sure how to extract only the words inside the parentheses. Hence, I thought it was possible to do a re.match parentheses to extract the words within the parentheses. But it's not working. Does anyone here have knowledge on this? Thanks a bunch in advance