#!/usr/bin/perl use Getopt::Long qw(:config no_auto_abbrev no_bundling); use Pod::Usage; my ($help,$man,$tag,$fs,$o); GetOptions( "help|h|?" => \$help, "man" => \$man, "tag" => \$tag, "fs=s" => \$fs, # "ouput|o=s" => \$o, ) or die "Specify the --help (or -?) option for usage information.\n"; ## "out|O:s" => \$multiout, use strict; use Text::TabDB; use utf8::all; my $esq = shift or die("Usage: $0 subschema file\n"); Text::TabDB::tabdiv( { ($fs ? (fs=>$fs):()), ($o ? (o => $o):()), ($tag ? (tag => 1):()) }, [split(/[,:;]/,$esq)],@ARGV); __END__ =head1 NAME tabdiv - textual relational databases Divide =head1 SYNOPSIS tabdiv subsckema tab > f tabdiv 'sex,age' f tabdiv '_1::_4' f (get fields 1 and 4) tabdiv -tag '_1::_4' f (get fields 1 and 4) =head1 DESCRIPTION Resorganise the table factorizing by the values of the fields input should be Unicode UTF8. If no input is provided, stdin is used. =head1 FORMATS each input table: country:capital first line - name of the fields Portugal:Lisboa tuple 1 France:Paris tuple 2 Spain:Madrid tuple n =head1 skema syntax fieldK:fieldj:... (if FS = ":") =head1 Options -tag =head1 AUTHOR J.Joao Almeida, jj@di.uminho.pt =head1 SEE ALSO perl(1). =cut