LibreCat / Catmandu-Exporter-Table

ASCII/Markdown table exporter for Catmandu
https://metacpan.org/pod/Catmandu::Exporter::Table
Other
0 stars 2 forks source link

NAME

Catmandu::Exporter::Table - ASCII/Markdown table exporter

STATUS

Build Status Coverage Status Kwalitee Score

SYNOPSIS

With catmandu command line client:

echo '{"one":"my","two":"table"} {"one":"is","two":"nice"}' | \ 
catmandu convert JSON --multiline 1 to Table
| one | two   |
|-----|-------|
| my  | table |
| is  | nice  |

catmandu convert CSV to Table --fields id,name --columns ID,Name < sample.csv
| ID | Name |
|----|------|
| 23 | foo  |
| 42 | bar  |
| 99 | doz  |

In Perl scripts:

use Catmandu::Exporter::Table;
my $exp = Catmandu::Exporter::Table->new;
$exp->add({ title => "The Hobbit", author => "Tolkien" });
$exp->add({ title => "Where the Wild Things Are", author => "Sendak" });
$exp->add({ title => "One Thousand and One Nights" });
$exp->commit;

| author  | title                       |
|---------|-----------------------------|
| Tolkien | The Hobbit                  |
| Sendak  | Where the Wild Things Are   |
|         | One Thousand and One Nights |

DESCRIPTION

This Catmandu::Exporter exports data in tabular form, formatted in MultiMarkdown syntax.

The output can be used for simple display, for instance to preview Excel files on the command line. Use Pandoc too further convert to other table formats, e.g. latex, html5, mediawiki:

catmandu convert XLS to Table < sheet.xls | pandoc -t html5

By default columns are sorted alphabetically by field name.

CONFIGURATION

METHODS

See Catmandu::Exporter

SEE ALSO

This module is based on Text::MarkdownTable.

Similar Catmandu Exporters for tabular data include Catmandu::Exporter::CSV, Catmandu::Exporter::XLS, and Catmandu::Exporter::XLSX.

COPYRIGHT AND LICENSE

Copyright Jakob Voss, 2014-

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.