Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 761 Bytes

README.md

File metadata and controls

19 lines (10 loc) · 761 Bytes

rubycsv

Convert CSV files to arbitrary formats via erb-style templates and lookups.

Basically, it reads in a CSV file, and then evaluates the ERB template on a per-line basis, using the header line to index the lines.

This allows additional per-input file logic in the conversion, and regex-based lookup tables in the templates.

This was originally created to use with ledger files, but can process any arbitrary CSV file into other formats. It was inspired in part by hledger's CSV conversion logic.

Usage

rubycsv.rb templatefile source_csv > outputfile

Example

There's a sample CSV and template file in examples folder - run it with:

./rubycsv.rb examples/savings.tpl examples/savings.csv