Guest User

Pentester708 (Telegram)

a guest
May 11th, 2023
1,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import os
  2.  
  3. os.system("print f '\033]2;Email Sorter By Pentester708\a'")
  4. print('\033[92m' + 'Creator: Pentester708(Telegram)' + '\033[0m')
  5.  
  6.  
  7. with open('input.txt', 'r') as file:
  8.     lines = file.readlines()
  9.  
  10. emails_by_domain = {}
  11. for line in lines:
  12.     email = line.strip()
  13.     domain = email.split('@')[-1]
  14.     if domain not in emails_by_domain:
  15.         emails_by_domain[domain] = []
  16.     emails_by_domain[domain].append(email)
  17.  
  18. # Create a directory to store the output files
  19. if not os.path.exists('output'):
  20.     os.makedirs('output')
  21.  
  22. # Write the email addresses to separate files for each domain
  23. for domain, emails in emails_by_domain.items():
  24.     filename = f'output/{domain}.txt'
  25.     with open(filename, 'w') as file:
  26.         file.write('\n'.join(emails))
  27.     print(f'Saved {len(emails)} emails to {filename}')
  28.  
Advertisement
Add Comment
Please, Sign In to add comment