import sys import os import random print("#!/bin/sh") filepaths = sys.argv[1:] random.shuffle(filepaths) for filepath in filepaths: filename = os.path.basename(filepath) year = filename[3:7] cmd = f"zstdcat --long=31 {filepath} | python extract_title_selftext.py | gzip >> submissions_parsed/reddit_title_text_{year}.jsonl.gz" print(cmd) os.system(cmd)