-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp.py
31 lines (22 loc) · 977 Bytes
/
temp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pandas as pd
# Function to filter and save the processed data
def filter_csv_file(file_path):
try:
# Load the CSV file
df = pd.read_csv(file_path)
# Ensure the relevant columns exist
if "Property Name" not in df.columns:
raise Exception(
"The CSV file must contain 'Property Name' column.")
# Filter out rows where Property Name starts with "Archive"
df_filtered = df[~df['Property Name'].str.startswith("Archive")]
# Save the filtered DataFrame to a new CSV file
df_filtered.to_csv(
"adobe_launch_rules_with_actions_filtered.csv", index=False)
print("Filtered data saved to adobe_launch_rules_with_actions_filtered.csv")
except Exception as e:
print(f"Error during processing: {e}")
if __name__ == "__main__":
# Modify the file path as needed
file_path = "adobe_launch_rules_with_actions.csv"
filter_csv_file(file_path)