1DBSORT(1) User Contributed Perl Documentation DBSORT(1)
2
3
4
6 dbsort - sort rows based on the the specified columns
7
9 dbsort [-M MemLimit] [-T TemporaryDirectory] [-nNrR] column [column...]
10
12 Sort all input rows as specified by the numeric or lexical columns.
13
14 Dbsort consumes a fixed amount of memory regardless of input size. (It
15 reverts to temporary files on disk if necessary, based on the -M and -T
16 options.)
17
18 The sort should be stable, but this has not yet been verified.
19
20 For large inputs (those that spill to disk), dbsort will do some of the
21 merging in parallel, if possible. The --parallel option can control
22 the degree of parallelism, if desired.
23
25 General option:
26
27 -M MaxMemBytes
28 Specify an approximate limit on memory usage (in bytes). Larger
29 values allow faster sorting because more operations happen in-
30 memory, provided you have enough memory.
31
32 -T TmpDir
33 where to put tmp files. Also uses environment variable TMPDIR, if
34 -T is not specified. Default is /tmp.
35
36 --parallelism N or -j N
37 Allow up to N merges to happen in parallel. Default is the number
38 of CPUs in the machine.
39
40 Sort specification options (can be interspersed with column names):
41
42 -r or --descending
43 sort in reverse order (high to low)
44
45 -R or --ascending
46 sort in normal order (low to high)
47
48 -n or --numeric
49 sort numerically
50
51 -N or --lexical
52 sort lexicographically
53
54 This module also supports the standard fsdb options:
55
56 -d Enable debugging output.
57
58 -i or --input InputSource
59 Read from InputSource, typically a file name, or "-" for standard
60 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
61 objects.
62
63 -o or --output OutputDestination
64 Write to OutputDestination, typically a file name, or "-" for
65 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
66 Fsdb::BoundedQueue objects.
67
68 --autorun or --noautorun
69 By default, programs process automatically, but Fsdb::Filter
70 objects in Perl do not run until you invoke the run() method. The
71 "--(no)autorun" option controls that behavior within Perl.
72
73 --header H
74 Use H as the full Fsdb header, rather than reading a header from
75 then input.
76
77 --help
78 Show help.
79
80 --man
81 Show full manual.
82
84 Input:
85 #fsdb cid cname
86 10 pascal
87 11 numanal
88 12 os
89
90 Command:
91 cat data.fsdb | dbsort cname
92
93 Output:
94 #fsdb cid cname
95 11 numanal
96 12 os
97 10 pascal
98 # | dbsort cname
99
101 dbmerge(1), dbmapreduce(1), Fsdb(3)
102
104 Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
105
106 This program is distributed under terms of the GNU general public
107 license, version 2. See the file COPYING with the distribution for
108 details.
109
110
111
112perl v5.28.1 2019-02-02 DBSORT(1)