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