2017 © Pedro Peláez
 

library column-parser

A library that parses columnar data from a string, e.g. from CLI output.

image

traderinteractive/column-parser

A library that parses columnar data from a string, e.g. from CLI output.

  • Monday, March 5, 2018
  • by traderinteractive
  • Repository
  • 22 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Column Parser

Build Status Scrutinizer Code Quality Coverage Status, (*1)

Latest Stable Version Latest Unstable Version License, (*2)

Total Downloads Daily Downloads Monthly Downloads, (*3)

A PHP library that parses columnar data from a string, e.g. from CLI output., (*4)

Requirements

This library requires PHP 7.0, or newer., (*5)

Installation

This package uses composer so you can just add traderinteractive/column-parser as a dependency to your composer.json file., (*6)

composer require traderinteractive/column-parser

Formats Supported

This library parses input that has to conform to a supported format., (*7)

Multispaced Headers

This parses a string where there are at least two spaces between the columns. The first line in the string is the headers. Each header is expected to be separated by at least two spaces. A single space is treated as interior space of the header (i.e. multiple-word headers)., (*8)

Example

For example, given the following $contents:, (*9)

Name     Age  City of Birth
James    17   San Francisco, CA
Mary     18   Washington, D.C.
William  22   Dallas, TX

and the following code:, (*10)

$parser = new MultispacedHeadersParser($contents);
$data = $parser->getRows();

would result in $data containing:, (*11)

array(
    array(
        'Name' => 'James',
        'Age' => '17',
        'City of Birth' => 'San Francisco, CA',
    ),
    array(
        'Name' => 'Mary',
        'Age' => '18',
        'City of Birth' => 'Washington, D.C.',
    ),
    array(
        'Name' => 'William',
        'Age' => '22',
        'City of Birth' => 'Dallas, TX',
    ),
);

Contributing

If you would like to contribute, please use our build process for any changes and after the build passes, send us a pull request on github!, (*12)

./vendor/bin/phpunit
./vendor/bin/phpcs

There is also a docker-based fig configuration that will execute the build inside a docker container. This is an easy way to build the application:, (*13)

fig run build

The Versions

05/03 2018

dev-master

9999999-dev

A library that parses columnar data from a string, e.g. from CLI output.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Spencer Rinehart
by Anthony Bittle

parser cli column

05/03 2018

v2.0.0

2.0.0.0

A library that parses columnar data from a string, e.g. from CLI output.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Spencer Rinehart
by Anthony Bittle

parser cli column

08/03 2014

v1.0.0

1.0.0.0

A library that parses columnar data from a string, e.g. from CLI output.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Spencer Rinehart
by Anthony Bittle

parser cli column