view contrib/tools/org_to_csv @ 1552:449b766ded50

extensions: fix dependency checking Fix extension dependency checking by unhiding "fd_ext_depends". (I accidentally broke this with the change on 2020-03-30 to hide symbols by default.)
author Luke Mewburn <luke@mewburn.net>
date Sat, 18 Jul 2020 18:38:11 +1000
parents a86eb3375b95
children
line wrap: on
line source

#!/usr/bin/env python

"""
Convert |-separated 11-column .org files to CSV,
with first and last empty columns ignored.
"""

import csv
import fileinput
import re
import sys

csvout = csv.writer(sys.stdout)
for line in fileinput.input():
    row = re.split(r'\s*\|\s*', line)
    row.extend([''] * (10 - len(row)))
    csvout.writerow(row[1:10])

# vim: set et sw=4 sts=4 :
"Welcome to our mercurial repository"