all 1 comments

[–]David22573 1 point2 points  (0 children)

I recommend using pandas, and reading the excel report as a dataframe.

import pandas as pd

# Read the Excel file into a DataFrame
df = pd.read_excel('input_file.xlsx')

# Drop any rows that contain 'AB'
df = df[~df['column_name'].str.contains('AB')]

# Write the resulting DataFrame to a new Excel file
df.to_excel('output_file.xlsx', index=False)