Text::LTSV - Labeled Tab Separeted Value manipulator
use Text::LTSV; my $p = Text::LTSV->new; my $hash = $p->parse_line("hoge:foo\tbar:baz\n"); is $hash->{hoge}, 'foo'; is $hash->{bar}, 'baz'; my $data = $p->parse_file('./t/test.ltsv'); # or parse_file_utf8 is $data->[0]->{hoge}, 'foo'; is $data->[0]->{bar}, 'baz'; # Only want certain fields? my $p = Text::LTSV->new; $p->want_fields('hoge'); $p->parse_line("hoge:foo\tbar:baz\n"); my $ltsv = Text::LTSV->new( hoge => 'foo', bar => 'baz', ); is $ltsv->to_s, "hoge:foo\tbar:baz";
Labeled Tab Separated Value http://stanaka.hatenablog.com/entry/2013/02/05/214833 is a Key-Value pair + line-based text format for log files, especially HTTP access_log.
This module provides a simple way to process LSTV-based string and files, which converts Key-Value pair(s) of LSTV to Perl's hash reference(s).
Naoya Ito <i.naoya@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::LTSV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::LTSV
CPAN shell
perl -MCPAN -e shell install Text::LTSV
For more information on module installation, please visit the detailed CPAN module installation guide.