dbmerge2 - merge exactly two inputs in sorted order based on the the specified columns
dbmerge2 --input A.fsdb --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
or cat A.fsdb | dbmerge2 --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
Merge exactly two sorted input files, producing one sorted result. Inputs can both be specified with --input, or one can come from standard input and the other from --input.
--input
Inputs must have identical schemas (columns, column order, and field separators).
Dbmerge2 consumes a fixed amount of memory regardless of input size.
Although described above as a command line too, the command line version of dbmerge2 is not installed by default. Dbmerge2 is used primarily internal to perl; dbmerge(1) is the command-line tool for user use.
General option:
Save output writer (for integration with other fsdb filters).
where to put tmp files. Also uses environment variable TMPDIR, if -T is not specified. Default is /tmp.
Sort specification options (can be interspersed with column names):
sort in reverse order (high to low)
sort in normal order (low to high)
sort numerically
sort lexicographically
This module also supports the standard fsdb options:
Enable debugging output.
Read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
-
Write to OutputDestination, typically a file name, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
By default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The --(no)autorun option controls that behavior within Perl.
--(no)autorun
Show help.
Show full manual.
File a.fsdb:
#fsdb cid cname 11 numanal 10 pascal
File b.fsdb:
#fsdb cid cname 12 os 13 statistics
dbmerge2 --input a.fsdb --input b.fsdb cname
or
cat a.fsdb | dbmerge2 --input b.fsdb cname
#fsdb cid cname 11 numanal 12 os 10 pascal 13 statistics # | dbmerge2 --input a.fsdb --input b.fsdb cname
dbmerge(1), dbsort(1), Fsdb(3)
$filter = new Fsdb::Filter::dbmerge2(@arguments);
Create a new object, taking command-line arugments.
$filter->set_defaults();
Internal: set up defaults.
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
$filter->setup();
Internal: setup, parse headers.
$filter->run();
Internal: run over each rows.
Copyright (C) 1991-2008 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.
To install Fsdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fsdb
CPAN shell
perl -MCPAN -e shell install Fsdb
For more information on module installation, please visit the detailed CPAN module installation guide.