![]() |
|
Combo List Splitter - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Sharing (https://sinister.li/Forum-Sharing) +--- Forum: Programs (https://sinister.li/Forum-Programs) +--- Thread: Combo List Splitter (/Thread-Combo-List-Splitter) Pages:
1
2
|
RE: Combo List Splitter - campo21 - 12-04-2019 link is down can you re-share this RE: Combo List Splitter - chunky - 12-12-2019 (12-04-2019, 11:55 PM)campo21 Wrote: link is down can you re-share this Sadly I don't have the code anymore but I just rewrote it in Python in case that helps you. Its usage should be self explainatory: Example: python split_combolist.py test.txt 5 Argument 1 - File to split Argument 2 - Amount of entries in each file Code: #!/usr/bin/python
import sys
if len(sys.argv) == 3:
file_path = sys.argv[1]
entries = sys.argv[2]
if entries.isdigit() and int(entries) > 0:
entries = int(entries)
try:
with open(file_path, 'r') as f:
count = 0
filecount = 1
for line in f.readlines():
try:
with open('combolist_part_' + str(filecount) + '.txt', 'a') as file_combo:
file_combo.write(line)
except IOError:
print('File not accessible!')
if count % entries == 0:
filecount += 1
count = 0
count += 1
# Do something with the file
except IOError:
print('File not accessible!')
else:
print('Your second parameter has to be a positive integer!')
else:
print('Invalid amount of parameters!')RE: Combo List Splitter - classicmosco222 - 08-29-2020 thanks for this i really appreciate it
RE: Combo List Splitter - mothered - 08-29-2020 (08-29-2020, 10:05 AM)classicmosco222 Wrote: thanks for this i really appreciate itThe link Is dead. |