DBMERGE2(1)
π DBMERGE2 β like, the perl-contributed manual page, bestie β¨
okay so this is dbmerge2, a User Contributed Perl Documentation page, and it's genuinely iconic once you get it. sit down, grab a lil snack π, and let's go.
πΈ NAME πΈ
dbmerge2 β merges exactly two inputs in sorted order, based on the columns you specify. exactly two. not three. don't even try it. π
π¦ SYNOPSIS π¦
dbmerge2 --input A.fsdb --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
or, the "one of them comes from stdin" era:
cat A.fsdb | dbmerge2 --input B.fsdb [-T TemporaryDirectory] [-nNrR]
column [column...]
π DESCRIPTION π
So the whole vibe: merge exactly two sorted input files, and produce one sorted result. that's it, that's the job. π
Both inputs can come in via --input, OR one can come from standard input while the other comes from --input. choose your fighter.
the inputs MUST have identical schemas β same columns, same column order, same field separators. no cap. if they don't match, that's a them problem.
The way dbmerge2 justβ¦ consumes a fixed amount of memory regardless of input size? obsessed. she does not care how big your files are. π₯
Although it's described above like a command-line tool, lowkey 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 actual user use. iykyk.
β οΈ Warning, bestie: we do not verify that each input is actually sorted. Incorrect merge results will occur if they are not. that's on you, fr fr. π
β¨ OPTIONS β¨
π«Ά General option:
--saveoutput $OUT_REFβ saves the output writer (for integration with other fsdb filters).<-T TmpDir>β where to put tmp files. it also uses the environment variableTMPDIRif-Tisn't specified. default is/tmp. ποΈ
π Sort specification options (can be interspersed with column names):
-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
π This module also supports the standard fsdb options:
-dβ enable debugging output.-ior--input InputSourceβ read from InputSource, typically a file name, or-for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--output OutputDestinationβ 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. π§--header Hβ useHas the full Fsdb header, rather than reading a header from then input.--helpβ show help.--manβ show full manual.
π SAMPLE USAGE π
π Input:
File a.fsdb:
#fsdb cid cname
11 numanal
10 pascal
File b.fsdb:
#fsdb cid cname
12 os
13 statistics
π¦ Command:
dbmerge2 --input a.fsdb --input b.fsdb cname
or
cat a.fsdb | dbmerge2 --input b.fsdb cname
β Output:
#fsdb cid cname
11 numanal
12 os
10 pascal
13 statistics
# | dbmerge2 --input a.fsdb --input b.fsdb cname
slay. look at that beautiful sorted merge. π
πΈ SEE ALSO πΈ
dbmerge(1), dbsort(1), Fsdb(3) β go read those too, they're all in the friend group. π«Ά
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2022 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.
k that's the whole page, bestie π this was perl v5.32.1, dated 2024-08-02, and it's the DBMERGE2(1) page β love that for us. go merge exactly two things and nothing more. periodt. π
π¦ 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