# Reading the new file and filtering the emails
with open('/mnt/data/Mail Pass.txt', 'r', encoding='utf-8') as file:
new_lines = file.readlines()
# Process lines to extract relevant emails and avoid duplicates
unique_emails = set()
filtered_emails = []
for line in new_lines:
parts = line.split(':')
email = parts[0].strip()
domain = email.split('@')[-1] if '@' in email else ''
if any(domain.endswith(d) for d in domains):
if email not in unique_emails:
unique_emails.add(email)
filtered_emails.append({'email': email})
# Convert to DataFrame
df_unique = pd.DataFrame(filtered_emails)
# Save to CSV
unique_csv_path = '/mnt/data/filtered_unique_emails.csv'
df_unique.to_csv(unique_csv_path, index=False)
unique_csv_path