https://github.com/devvoh/fixed-width
Fixed Width File Reader & Generator
https://github.com/devvoh/fixed-width
Last synced: 12 months ago
JSON representation
Fixed Width File Reader & Generator
- Host: GitHub
- URL: https://github.com/devvoh/fixed-width
- Owner: devvoh
- License: unlicense
- Created: 2016-11-09T19:42:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-29T10:43:21.000Z (almost 5 years ago)
- Last Synced: 2025-03-25T17:49:15.368Z (about 1 year ago)
- Language: PHP
- Size: 36.1 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Fixed Width File Reader & Generator
[](https://packagist.org/packages/devvoh/fixedwidth)
[](https://packagist.org/packages/devvoh/fixedwidth)
[](https://packagist.org/packages/devvoh/fixedwidth)
Fixed-width is a simple library that can make working with fixed width file formats much easier. You define a Schema for a line, which can have a delimiter or not, and both the Reader and Generator will work with that Schema.
You can define valid characters, and the line or data will be rejected if it doesn't adhere to it. If a delimiter is found in a data value, it's rejected. If a line is rejected, the `Reader` will return `null`, which you can then interpret as you wish. If a dataItem is rejected, the `Generator` will return `-- invalid data: data`.
## Requirements
- PHP 5.6, PHP 7
## Installation
Fixed-width can be installed by using [Composer](http://getcomposer.org/). Simply run:
`composer require devvoh/fixedwidth`
## License
Fixed-width is open-sourced software licensed under the [Unlicense](http://unlicense.org/).