ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

⭐PYTHON COMBOLIST CLEANER⭐


  • Please log in to reply
⭐PYTHON COMBOLIST CLEANER⭐

#1

ZerNoK
ZerNoK
    Offline
    13
    Rep
    261
    Likes

    Addicted

Posts: 181
Threads: 50
Joined: Jan 17, 2022
Credits: 0

Two years registered
#1

!!!NO LEECHERS!!!

 

Made this for personal use but it's a very simple program (21 lines) and requires no libraries. It takes the file you give it in the first input to read over and then it asks what email domain you want to keep for your results before finally writing to a new txt files :wub:

# Where your results will be written
output_file = 'cleaned_combo.txt'

# Combo txt file you want to clean
file_name = input("Enter your file name: ")

# Reading over combo file
with open(file_name, 'r', encoding='utf-8') as file:
	data = file.readlines()
	line_count = len(data)

# Asking what email domain to keep. Example = @gmail.com OR @yahoo.com
email = input("What email domain do you want to keep: ").lower()

# Write results to file
with open(output_file, 'w', encoding='utf-8') as outfile:
    for line in data:
        if email in line:
            outfile.write(line)

print(f"Lines not containing {email} have been removed. Cleaned data saved to {output_file}!")

 


  • 0

#2

spongebob222
spongebob222
    Offline
    2
    Rep
    4
    Likes

    New Member

Posts: 11
Threads: 0
Joined: Dec 18, 2024
Credits: 0
#2

cool bt why not just

grep '@gmail.com' input_combo.txt > output_combo.txt

no python needed


  • 1

#3

ZerNoK
ZerNoK
    Offline
    13
    Rep
    261
    Likes

    Addicted

Posts: 181
Threads: 50
Joined: Jan 17, 2022
Credits: 0

Two years registered
#3

cool bt why not just

grep '@gmail.com' input_combo.txt > output_combo.txt

no python needed

Was working off Windows not Linux so just made a little something small


  • 0

#4

spongebob222
spongebob222
    Offline
    2
    Rep
    4
    Likes

    New Member

Posts: 11
Threads: 0
Joined: Dec 18, 2024
Credits: 0
#4

aight

small tip tho, u dont need to read the whole thing in mem first

example:

with open(output_file, 'w', encoding='utf-8') as outfile:
    with open(file_name, 'r') as file:
        for line in file:
	    if email in line:
                outfile.write(line)

 


  • 1

#5

ZerNoK
ZerNoK
    Offline
    13
    Rep
    261
    Likes

    Addicted

Posts: 181
Threads: 50
Joined: Jan 17, 2022
Credits: 0

Two years registered
#5

 

aight

small tip tho, u dont need to read the whole thing in mem first

example:

with open(output_file, 'w', encoding='utf-8') as outfile:
    with open(file_name, 'r') as file:
        for line in file:
	    if email in line:
                outfile.write(line)

Thanks for this bro


  • 0


 Users browsing this thread: and 3 guests