rynaro / estratto Goto Github PK
View Code? Open in Web Editor NEWparsing fixed width files content made easy
License: MIT License
parsing fixed width files content made easy
License: MIT License
In version 1.0.0 we only accept file paths as parameters in Document
entry point.
One great improvement to gem is accept the File
, and YAML
objects from caller system. This feature makes gem more flexible for integration.
Third-party files sometimes has lack of data integrity. It's not uncommon, you need to parse a date (like birthdate), and third-party file does not contain this information in the specified range.
Today, estratto raises error trying to parse the date format, 'cause ' '
isnt valid date to parse.
In formats
node, we'll insert a new property called allow_empty
receiving a boolean
value. When this value was true
, estratto will return nil
value to avoid any problems, and keeping data integrity. (Using premise, if we don't get data from range, a nil
data can describe the actual state)
If value is false
or allow_empty
omitted, estratto will raise errors as default behaviour.
- name: birthdate
range: 137..144
type: DateTime
formats:
allow_empty: true
format: '%Y%m%d'
Estratto uses the CharlockHolmes gem which depends on ICU to check the input file encoding.
It is necessary to add a section on README describing this dependency and provide install instructions for libicu-dev
otherwise the user may face the following error message:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Estratto was builted with intent to deal with multi-layout as primary context, but one of most common layout type of fixed width.
In mono layout type generally has header, and footer, that these lines do not shares the same pattern of principal content lines.
Suggested initial point of this feature:
layout:
name: 'monolayout'
multi-register: false # or nonexistent key
header: true
footer: true
registers:
- header:
# content
- register:
# content
- footer:
# content
Add a safe_data: true
or sanitize: true
option to get rid off invalid characters.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.