# Print the labels of a JSONL file touching [FROM, TO): id, start, end, family, description. Args: file FROM TO import json, sys f, a, b = sys.argv[1:4] for line in open(f): if not line.strip(): continue l = json.loads(line) if l["start"] < b and l["end"] >= a: print(l["id"], l["start"], l["end"], l["family"], "|", l["description"])