I wrote a Python script that takes a CSV (or other delimited flat file) and a JSON mapping file, and converts the flat file into a newly/differently formatted flat file based on what is specified in the JSON mapping file.
I call it autoff.
The code repository is here.