Read fixed-length files:
01A Name 20130101SKIPA
Support lazy processing so it's possible to read very large files as well.
Add this line to your application's Gemfile:
gem 'haecksler'
And then execute:
$ bundle
Or install it yourself as:
$ gem install haecksler
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
- Fork it ( https://github.com/[my-github-username]/haecksler/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request