Post: [Python] Word-list merge and sort script
11-14-2013, 04:21 AM #1
Dan
I'm a god.
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys, this idea came to when having to manually go through and type the commands for merging my word-list. It was a trial-and-error thing I hardly any Python experience, I did receive come help, but here you go:

I may update this script as I go on, not sure. As of right now, this only works on Linux. Though I'm planning on making it Windows compatible.

Description: It basically just merge's all your word-list (.txt) into one file, then you are given the choice to sort that file (remove the dupes).

    
#!/usr/bin/python
#!/usr/bin/env python
import os, time, subprocess

title = """
_____ _____
| __ \ | __ \
| | | |_ _ _ __ ___ | |__) |___ _ __ ___ _____ _____ _ __
| | | | | | | '_ \ / _ \ | _ // _ \ '_ ` _ \ / _ \ \ / / _ \ '__|
| |__| | |_| | |_) | __/ | | \ \ __/ | | | | | (_) \ V / __/ |
|_____/ \__,_| .__/ \___| |_| \_\___|_| |_| |_|\___/ \_/ \___|_|
| |
|_|
Python - Dupe Remover v1.0 By Shadow
"""

print title

os.chdir(os.getenv("HOME"))
curr_dir = os.getcwd()
print "Current directory:", curr_dir

print "Make sure your directory is writable!"

path_to_wordlist = raw_input("Path to wordlist: ")
if os.path.isdir(path_to_wordlist):
os.chdir(path_to_wordlist)
os.system("ls")
check_if_join = raw_input("Do you want to merge all wordlist files to a txt?(y/n): ")
if check_if_join == "y":
file_name_to_merge = raw_input("File name to merge others to: ") + ".txt"
print "This may take a long time depending on your wordlist size!"
f_open = open(file_name_to_merge, 'w'Winky Winky.close()
f_string = str(file_name_to_merge)
os.system("cat *.txt >> "+f_string)

check_if_user_sort = raw_input("Would you like to sort the wordlist file?(y/n) ")
if check_if_user_sort == "y":
f_string = str(file_name_to_merge)
os.system("sort -u "+f_string)
print "Merging and sorting is done!"
else:
exit
else:
print path_to_wordlist+"is not a directory!"
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo