mirror of
https://github.com/bvanroll/odiseectf.git
synced 2025-08-29 11:52:43 +00:00
patterns shit
This commit is contained in:
40
patterns/realcomb.py
Normal file
40
patterns/realcomb.py
Normal file
@@ -0,0 +1,40 @@
|
||||
#it just actually combines files by appending the lines of one to another
|
||||
|
||||
import sys, os
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("usage python blabal.py file1 ....")
|
||||
sys.exit()
|
||||
|
||||
|
||||
|
||||
files = []
|
||||
for i,x in enumerate(sys.argv):
|
||||
if i > 0:
|
||||
files.append(x)
|
||||
|
||||
|
||||
lines = []
|
||||
title = ""
|
||||
|
||||
for f in files:
|
||||
title = title+f
|
||||
|
||||
with open(f, "r") as infile:
|
||||
lines.extend(infile.readlines())
|
||||
|
||||
|
||||
for i,l in enumerate(lines):
|
||||
if " " in l:
|
||||
temp = l
|
||||
lines.pop(i)
|
||||
temp.split(" ")
|
||||
lines.extend(temp)
|
||||
|
||||
with open(title, "w") as outfile:
|
||||
outfile.writelines(lines)
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user