This entry is part 12 of 19 in the Bash-whacking series

After trying various sed/awk recipes to convert from fixed-width to CSV, I found a Python script that works well.

Here it is, from http://code.activestate.com/recipes/452503-convert-db-fixed-width-output-to-csv-format/

## {{{ http://code.activestate.com/recipes/452503/ (r1)
# Ian Maurer
# http://itmaurer.com/
# Convert a Fixed Width file to a CSV with Headers
#
# Requires following format:
#
# header1      header2 header3
# ———— ——- —————-
# data_a1      data_a2 data_a3
'"''"', ") + '"'
    data = ",""\n""__main__""r""w+""Usage: python convert.py <input> <output>"
## end of http://code.activestate.com/recipes/452503/ }}}