LTSV formatted text parser and builder for perl6
Perl 6
Switch branches/tags
Nothing to show
Latest commit 299f787 Apr 28, 2017 @moznion committed on GitHub Merge pull request #2 from samcv/SPDX-license
Use SPDX identifier in license field of META6.json
Permalink
Failed to load latest commit information.
lib/Text Fix silly typo Oct 19, 2015
t Implement fundamental functions Oct 19, 2015
.gitignore Initial commit Oct 14, 2015
.travis.yml Initial commit Oct 14, 2015
LICENSE Initial commit Oct 14, 2015
META6.json Merge branch 'master' into SPDX-license Apr 28, 2017
README.md Fix silly typo Oct 19, 2015

README.md

Build Status

NAME

Text::LTSV - LTSV (Labeled Tab Separated Value) toolkit

SYNOPSIS

use Text::LTSV;

my $ltsv = Text::LTSV.new;

## one line
$ltsv.stringify(Array[Pair].new(
    'foo'  => 'bar',
    'buz'  => 'qux',
    'john' => 'paul',
)); # => "foo:bar\tbuz:qux\tjohn:paul"

## multiple lines
$ltsv.stringify(Array[Array[Pair]].new(
    Array[Pair].new('foo' => 'bar'),
    Array[Pair].new('buz' => 'qux'),
)); # => "foo:bar\nbuz:qux"

## With parser
use Text::LTSV::Parser;
my $parser = Text::LTSV::Parser.new;
$ltsv.stringify($parser.parse-line("foo:bar\tbuz:qux\tjohn:paul\n")); # => "foo:bar\tbuz:qux\tjohn:paul"
$ltsv.stringify($parser.parse-text("foo:bar\tbuz:qux\njohn:paul\tgeorge:ringo\n")); # => "foo:bar\tbuz:qux\njohn:paul\tgeorge:ringo"

DESCRIPTION

Text::LTSV is a builder for LTSV (Labeled Tab Separated Values).

METHODS

multi method stringify(Pair @key-values) returns Str

Stringify LTSV as one line.

multi method stringify(Array[Pair] @multi-key-values) returns Str

Stringify LTSV as multiple lines. You can specify new line character by $.nl. Default $.nl is "\n";

SEE ALSO

  • Text::LTSV::Parser

AUTHOR

moznion moznion@gmail.com

COPYRIGHT AND LICENSE

Copyright 2015 moznion

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.