Skip to content

Generic ruby csv to template converter. Mainly for ledger files.

Notifications You must be signed in to change notification settings

artisancomputer/rubycsv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Generic ruby csv to template converter. Mainly for ledger files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages