Project

haecksler

0.0
No commit activity in last 3 years
No release in over 3 years
Haecksler is the German word for a wood chipper, the library processes fixed-length files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Haecksler

Code Climate Build Status Dependency Status Coverage Status

Read fixed-length files:

01A Name    20130101SKIPA

Support lazy processing so it's possible to read very large files as well.

Installation

Add this line to your application's Gemfile:

gem 'haecksler'

And then execute:

$ bundle

Or install it yourself as:

$ gem install haecksler

Usage

file = File.open(File.expand_path("../complete.txt",__FILE__))

result = Haecksler.chop(file) do |h|

  h.header_trap {|header| header =~/^FILE/ }
  h.header "HName", 4
  h.header "HExtra", 6

  h.column "Id", 2, :integer
  h.column "Name", 10
  h.column "Date", 8, :date

  h.footer_trap {|footer| footer =~/^END/ }
  h.footer "FFooter", 3
  h.footer "FDate", 8, :date
end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/haecksler/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request