# import pandas as pd # # Load the dataset (adjust the filename if needed) # mid_df = pd.read_excel('./search/MID.xlsx') # # Extract and clean medicine names # valid_med_names = ( # mid_df['NAME'] # .dropna() # .str.strip() # .str.lower() # .unique() # .tolist() # ) # # Save to a text file # with open('valid_med_names.txt', 'w', encoding='utf-8') as f: # for name in valid_med_names: # f.write(f"{name}\n") # print(f"Saved {len(valid_med_names)} unique medicine names to valid_med_names.txt") import pandas as pd # Load the Excel file (specify the sheet name if needed) df = pd.read_excel("search/MID.xlsx") # or pd.read_excel("your_file.xlsx", sheet_name="Sheet1") # Get the column headers headings = df.columns.tolist() print("Headings:", headings)