import glob
with open("all_files.json", "w") as output:
for f in glob.glob("*.json"):
with open(f, "r") as input:
line = None
for line in input:
output.write(line)
'''
data1.json
[
{"url": "https://www.collectivesolver.com/", "title": "Collective Solver"},
{"url": "https://www.collectivesolver.com/32116/how-to-split-a-string-in-c", "title": "How to split a string in C - Collective Solver"}
]
'''
'''
data2.json
[
{"url": "https://www.collectivesolver.com/32105/how-to-trim-a-string-in-c", "title": "How to trim a string in C - Collective Solver"},
{"url": "https://www.collectivesolver.com/32098/how-to-remove-all-spaces-from-a-string-in-c", "title": "How to remove all spaces from a string in C - Collective Solver"}
]
'''
# all_files.json
'''
run:
[
{"url": "https://www.collectivesolver.com/", "title": "Collective Solver"},
{"url": "https://www.collectivesolver.com/32116/how-to-split-a-string-in-c", "title": "How to split a string in C - Collective Solver"}
][
{"url": "https://www.collectivesolver.com/32105/how-to-trim-a-string-in-c", "title": "How to trim a string in C - Collective Solver"},
{"url": "https://www.collectivesolver.com/32098/how-to-remove-all-spaces-from-a-string-in-c", "title": "How to remove all spaces from a string in C - Collective Solver"}
]
'''