Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 64 lines (40 sloc) 1.557 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
#!/usr/bin/perl
use App::PipeFilter::JsonCut;
exit App::PipeFilter::JsonCut->new_with_options()->run();

__END__

=pod

=head1 NAME

jcut - cut out selected portions of each JSON object in a file

=head1 SYNOPSIS

jcut -o field_1 [-o field_2 ...] [--verbose] [file ...]

=head1 DESCRIPTION

jcut(1) cuts out selected portions of each JSON record and writes them
to standard output. Multiple output fields may be specified, one per
-o flag.

=head1 SEE ALSO

You may read this utility's implementation in its entirety at

perldoc -m jcut

L<App::PipeFilter::JsonCut> implements this utility, including the
behavior of the -o flag.

The jsonpath(1) utility performs a similar function, but output fields
are specified by JSON::Path expressions instead of simple field names.
jsonpath(1) can therefore extract data from more complex JSON objects.

L<App::PipeFilter> has top-level documentation including a table of
contents for all the libraries and utilities included in the project.

=head1 PRO TIPS

JSON is relatively verbose compared to the whitespace-separated
formats that UNIX tools usually deal with. It's often beneficial to
jcut(1) the fields you need early in a pipeline chain and discard any
extraneous data.

=head1 BUGS

L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-PipeFilter>

=head1 REPOSITORY

L<https://github.com/rcaputo/app-pipefilter>

=head1 COPYRIGHT AND LICENSE

jcut
is Copyright 2011 by Rocco Caputo.
All rights are reserved.
jcut
is released under the same terms as Perl itself.

=cut

# vim: ts=2 sw=2 expandtab
Something went wrong with that request. Please try again.