"""Print the header of the OFF CSV export (reads only the first line, streaming).""" import gzip, sys path = sys.argv[1] with gzip.open(path, 'rt', encoding='utf-8', newline='') as f: header = f.readline().rstrip('\r\n').split('\t') print(len(header), 'columns') for i, c in enumerate(header): print(i, c)