DBMERGE2(1)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

πŸ’… 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 variable TMPDIR if -T isn't specified. default is /tmp. πŸ—‚οΈ

🌈 Sort specification options (can be interspersed with column names):

  • -r or --descending β€” sort in reverse order (high to low)
  • -R or --ascending β€” sort in normal order (low to high)
  • -n or --numeric β€” sort numerically
  • -N or --lexical β€” sort lexicographically

πŸ’œ This module also supports the standard fsdb options:

  • -d β€” enable debugging output.
  • -i or --input InputSource β€” read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • -o or --output OutputDestination β€” write to OutputDestination, typically a file name, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • --autorun or --noautorun β€” 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. 🧚
  • --header H β€” use H as 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. 🫢


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