Login Register


Does such a tool exist? filter_list
Author
Message
Does such a tool exist? #1
Been looking everywhere and can't find it. Hoping for a tool which will split a text document into 3 equal lists in the following way :

Original List :
Code:
a b c d e f

Say I enter the number 3 it would output :

Splitlists :

1 - ad
2 - be
3 - cf

That might be a bit confusing , let me know if you need more clarification?
(This post was last modified: 06-25-2019, 07:36 PM by Biglad465.)
Discord : Whiteey#3760

Justeat vouchers sold! Msg me!

Reply

RE: Does such a tool exist? #2
I believe this is the "tool" you're looking for, let me know if that's what you meant.


Ransomware is more about manipulating vulnerabilities in human psychology than the adversary’s technological sophistication.

Reply

RE: Does such a tool exist? #3
Ohh so you want to input a number and have a program split a list into equal groups. I'm sure that would be relatively easy to make, but I can't right now.
(This post was last modified: 06-25-2019, 10:46 PM by Drako.)
â €
[Image: KmPTi6b.png]

Reply

RE: Does such a tool exist? #4
That would be easy to do in python. Just had a quick look on stack overflow and edited it so it should split into three parts.

def file_len(fname):
with open(fname) as f:
for i, l in enumerate(f):
pass
return i + 1

#change input.txt to your file name
line_num = file_len(input.txt)
splitLen = line_num/3 # 20 lines per file
outputBase = 'output' # output.1.txt, output.2.txt, etc.


input = open('input.txt', 'r').read().split('\n')



at = 1
for lines in range(0, len(input), splitLen):
# First, get the list slice
outputData = input[lines:lines+splitLen]

# Now open the output file, join the new slice with newlines
# and write it out. Then close the file.
output = open(outputBase + str(at) + '.txt', 'w')
output.write('\n'.join(outputData))
output.close()

# Increment the counter
at += 1

Not tested it but it should work.

Reply

RE: Does such a tool exist? #5
I had coded this a year ago but I lost it, it is very helpfull with threading.
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply







Users browsing this thread: