Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/progrhyme/perl-text-ltsv-liner

A simple and line-oriented LTSV parser
https://github.com/progrhyme/perl-text-ltsv-liner

Last synced: about 2 months ago
JSON representation

A simple and line-oriented LTSV parser

Awesome Lists containing this project

README

        

# NAME

Text::LTSV::Liner - Line filter of LTSV text

# SYNOPSIS

use Text::LTSV::Liner;
my $liner = Text::LTSV::Liner->new( key => \@keys );
while(<>) {
$liner->run($_);
}

# DESCRIPTION

Labeled Tab-separated Values (LTSV) format is a variant of Tab-separated
Values (TSV). (cf: [http://ltsv.org/](http://ltsv.org/))
This module simply filters text whose format is LTSV by specified keys.

# METHODS

## new

Constructor.
You can specify some options to filter lines.

- **key**

You can choose keys as array reference which you want to see in filtered output.

- **no-color**

If you prefer no-colorized output, specify this option.

- **no-key**

If you don't need to see keys in the output, specify this option.
Then you'll see values only in the output.

## run

Process lines and print output to STDOUT.

## parse

my $liner = Text::LTSV::Liner->new( key => \@keys );
for my $line (@lines) {
my $parsed = $liner->parse($line);
}

This method is convinent if you want to use the filtered output in your codes.

# AUTHORS

IKEDA Kiyoshi

# LICENSE

Copyright (C) 2013-2017 IKEDA Kiyoshi.

This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. That means either (a) the GNU General Public
License or (b) the Artistic License.