1DBMERGE(1) User Contributed Perl Documentation DBMERGE(1)
2
3
4
6 dbmerge - merge all inputs in sorted order based on the the specified
7 columns
8
10 dbmerge --input A.fsdb --input B.fsdb [-T TemporaryDirectory] [-nNrR] column [column...]
11
12 or
13 cat A.fsdb | dbmerge --input - --input B.fsdb [-T
14 TemporaryDirectory] [-nNrR] column [column...]
15
16 or
17 dbmerge [-T TemporaryDirectory] [-nNrR] column [column...] --inputs
18 A.fsdb [B.fsdb ...]
19
20 or
21 { echo "A.fsdb"; echo "B.fsdb" } | dbmerge --xargs column
22 [column...]
23
25 Merge all provided, pre-sorted input files, producing one sorted
26 result. Inputs can both be specified with "--input", or with
27 "--inputs", or one can come from standard input and the other from
28 "--input". With "--xargs", each line of standard input is a filename
29 for input.
30
31 Inputs must have identical schemas (columns, column order, and field
32 separators).
33
34 Unlike dbmerge2, dbmerge supports an arbitrary number of input files.
35
36 Because this program is intended to merge multiple sources, it does not
37 default to reading from standard input. If you wish to read standard
38 input, giv - as an explicit input source.
39
40 Also, because we deal with multiple input files, this module doesn't
41 output anything until it's run.
42
43 dbmerge consumes a fixed amount of memory regardless of input size. It
44 therefore buffers output on disk as necessary. (Merging is implemented
45 a series of two-way merges and possibly an n-way merge at the end, so
46 disk space is O(number of records).)
47
48 dbmerge will merge data in parallel, if possible. The "--parallelism"
49 option can control the degree of parallelism, if desired.
50
52 General option:
53
54 --xargs
55 Expect that input filenames are given, one-per-line, on standard
56 input. (In this case, merging can start incrementally.)
57
58 --removeinputs
59 Delete the source files after they have been consumed. (Defaults
60 off, leaving the inputs in place.)
61
62 -T TmpDir
63 where to put tmp files. Also uses environment variable TMPDIR, if
64 -T is not specified. Default is /tmp.
65
66 --parallelism N or -j N
67 Allow up to N merges to happen in parallel. Default is the number
68 of CPUs in the machine.
69
70 --endgame (or --noendgame)
71 Enable endgame mode, extra parallelism when finishing up. (On by
72 default.)
73
74 Sort specification options (can be interspersed with column names):
75
76 -r or --descending
77 sort in reverse order (high to low)
78
79 -R or --ascending
80 sort in normal order (low to high)
81
82 -n or --numeric
83 sort numerically
84
85 -N or --lexical
86 sort lexicographically
87
88 This module also supports the standard fsdb options:
89
90 -d Enable debugging output.
91
92 -i or --input InputSource
93 Read from InputSource, typically a file name, or "-" for standard
94 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
95 objects.
96
97 -o or --output OutputDestination
98 Write to OutputDestination, typically a file name, or "-" for
99 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
100 Fsdb::BoundedQueue objects.
101
102 --autorun or --noautorun
103 By default, programs process automatically, but Fsdb::Filter
104 objects in Perl do not run until you invoke the run() method. The
105 "--(no)autorun" option controls that behavior within Perl.
106
107 --header H
108 Use H as the full Fsdb header, rather than reading a header from
109 then input.
110
111 --help
112 Show help.
113
114 --man
115 Show full manual.
116
118 Input:
119 File a.fsdb:
120
121 #fsdb cid cname
122 11 numanal
123 10 pascal
124
125 File b.fsdb:
126
127 #fsdb cid cname
128 12 os
129 13 statistics
130
131 These two files are both sorted by "cname", and they have identical
132 schemas.
133
134 Command:
135 dbmerge --input a.fsdb --input b.fsdb cname
136
137 or
138
139 cat a.fsdb | dbmerge --input b.fsdb cname
140
141 Output:
142 #fsdb cid cname
143 11 numanal
144 12 os
145 10 pascal
146 13 statistics
147 # | dbmerge --input a.fsdb --input b.fsdb cname
148
150 dbmerge2(1), dbsort(1), Fsdb(3)
151
153 Copyright (C) 1991-2020 by John Heidemann <johnh@isi.edu>
154
155 This program is distributed under terms of the GNU general public
156 license, version 2. See the file COPYING with the distribution for
157 details.
158
159
160
161perl v5.38.0 2023-07-20 DBMERGE(1)