DBMERGE(1)
π DBMERGE(1) β like, the merge manual, bestie
okay so real quick: this is dbmerge from the User Contributed Perl Documentation section of the manual, and honestly? she's an icon. let's get into it π«Ά
β¨ NAME β¨
dbmerge β merge all your inputs into one sorted result, sorted by the columns you specifiy. yes. the columns. the ones you named. π
π¦ SYNOPSIS π¦
dbmerge --input A.fsdb --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
or
cat A.fsdb | dbmerge --input - --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
or
dbmerge [-T TemporaryDirectory] [-nNrR] column [column...] --inputs A.fsdb [B.fsdb ...]
or
{ echo "A.fsdb"; echo "B.fsdb" } | dbmerge --xargs column [column...]
πΈ DESCRIPTION πΈ
So the whole vibe: you hand her a bunch of pre-sorted input files and she merges them all into one sorted result. that's it, that's the post π
You can name your inputs with --input, or with --inputs, or do the cute mixed thing where one comes from standard input and the other comes from --input. And with --xargs, every single line of standard input is a filename for input. one per line, no cap.
β οΈ heads up bestie: inputs must have identical schemas β same columns, same column order, and same field separators. no mixing and matching, she will not be doing that π
Unlike dbmerge2, dbmerge supports an arbitrary number of input files. literally as many as you want. main character energy π
And because this program is built to merge multiple sources, she does not default to reading from standard input. you want stdin? use - as the input source. periodt.
Also, because we're dealing with multiple input files, this module doesn't output anything until it's run. like, nothing. she's cooking. π₯
dbmerge consumes a fixed amount of memory regardless of input size. iconic. so she buffers output on disk as necessary. (the merging is implemented as a series of two-way merges and possibly an n-way merge at the end, so disk space is O(number of records).)
dbmerge will merge data in parallel, if possible. the --parallelism option can control the degree of parallelism, if you're feeling controlling π
β¨ OPTIONS β¨
general option(s):
--xargsβ expect that input filenames are given, one-per-line, on standard input. (in this case, merging can start incrementally. slay.)--removeinputsβ delete the source files after they've been consumed. (defaults off, so your inputs stay right where they are π)-TTmpDir β where to put tmp files. also uses the environment variableTMPDIRif-Tisn't specified. default is/tmp.--parallelismN or-jN β allow up to N merges to happen in parallel. default is the number of CPUs in the machine. she's built different.--endgame(or--noendgame) β enable endgame mode, extra parallelism when finishing up. (on by default. we love a strong finish π«Ά)
sort specification options (these can be interspersed with column names, iykyk):
-ror--descendingβ sort in reverse order (high to low)-Ror--ascendingβ sort in normal order (low to high)-nor--numericβ sort numerically-Nor--lexicalβ sort lexicographically
also, this module supports the standard fsdb options π
-dβ enable debugging output.-ior--inputInputSource β read from InputSource, typically a file name, or-for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--outputOutputDestination β write to OutputDestination, typically a file name, or-for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the--(no)autorunoption controls that behavior within Perl.--headerH β use H as the full Fsdb header, rather than reading a header from then input.--helpβ show help. π₯Ί--manβ show full manual. (hi, that's this π )
π SAMPLE USAGE π
input:
File a.fsdb:
#fsdb cid cname
11 numanal
10 pascal
File b.fsdb:
#fsdb cid cname
12 os
13 statistics
These two files are both sorted by "cname", and they have identical schemas. perfect match, honestly π
command:
dbmerge --input a.fsdb --input b.fsdb cname
or
cat a.fsdb | dbmerge --input b.fsdb cname
output:
#fsdb cid cname
11 numanal
12 os
10 pascal
13 statistics
# | dbmerge --input a.fsdb --input b.fsdb cname
like?? ate and left no crumbs π
π SEE ALSO π
dbmerge2(1), dbsort(1), Fsdb(3)
go read those too, bestie, they're all part of the family π¦
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2024 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.
and that's the whole page, bestie β¨ this one's from perl v5.32.1, dated 2024-08-02, and it's DBMERGE(1) β go merge something iconic π
π
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms