1Fsdb::Filter::dbrowcounUts(e3r)Contributed Perl DocumentFastdibo:n:Filter::dbrowcount(3)
2
3
4
6 dbrowcount - count the number of rows in an Fsdb stream
7
9 dbrowcount
10
12 Count the number of rows and write out a new fsdb file with one column
13 (n) and one value: the number of rows. This program is a strict subset
14 of dbcolstats.
15
16 Although there are other ways to get a count of rows ("dbcolstats", or
17 "dbrowaccumulate -C 1" and some processing), counting is so common it
18 warrants its own command. (For example, consider how often "wc -l" is
19 used in regular shell scripting.) There are some gross and subtle
20 differences, though, in that "dbrowcount" doesn't require one to
21 specify a column to search, and it also doesn't look for and skip null
22 data items.
23
25 No program-specific options.
26
27 This module also supports the standard fsdb options:
28
29 -d Enable debugging output.
30
31 -i or --input InputSource
32 Read from InputSource, typically a file name, or "-" for standard
33 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
34 objects.
35
36 -o or --output OutputDestination
37 Write to OutputDestination, typically a file name, or "-" for
38 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
39 Fsdb::BoundedQueue objects.
40
41 --autorun or --noautorun
42 By default, programs process automatically, but Fsdb::Filter
43 objects in Perl do not run until you invoke the run() method. The
44 "--(no)autorun" option controls that behavior within Perl.
45
46 --help
47 Show help.
48
49 --man
50 Show full manual.
51
53 Input:
54 #fsdb absdiff
55 0
56 0.046953
57 0.072074
58 0.075413
59 0.094088
60 0.096602
61 # | /home/johnh/BIN/DB/dbrow
62 # | /home/johnh/BIN/DB/dbcol event clock
63 # | dbrowdiff clock
64 # | /home/johnh/BIN/DB/dbcol absdiff
65
66 Command:
67 cat data.fsdb | dbrowcount
68
69 Output:
70 #fsdb n
71 6
72 # | /home/johnh/BIN/DB/dbrow
73 # | /home/johnh/BIN/DB/dbcol event clock
74 # | dbrowdiff clock
75 # | /home/johnh/BIN/DB/dbcol absdiff
76
77 Input 2:
78 As another example, this input produces the same output as above in
79 "dbrowcount", but different output in "dbstats":
80
81 #fsdb absdiff
82 -
83 -
84 -
85 -
86 -
87 -
88 # | /home/johnh/BIN/DB/dbrow
89 # | /home/johnh/BIN/DB/dbcol event clock
90 # | dbrowdiff clock
91 # | /home/johnh/BIN/DB/dbcol absdiff
92
94 dbcolaccumulate(1), dbcolstats(1), Fsdb(3)
95
97 new
98 $filter = new Fsdb::Filter::dbrowcount(@arguments);
99
100 set_defaults
101 $filter->set_defaults();
102
103 Internal: set up defaults.
104
105 parse_options
106 $filter->parse_options(@ARGV);
107
108 Internal: parse options
109
110 setup
111 $filter->setup();
112
113 Internal: setup, parse headers.
114
115 run
116 $filter->run();
117
118 Internal: run over all IO
119
120 finish
121 $filter->finish();
122
123 Internal: write trailer.
124
126 Copyright (C) 2007-2015 by John Heidemann <johnh@isi.edu>
127
128 This program is distributed under terms of the GNU general public
129 license, version 2. See the file COPYING with the distribution for
130 details.
131
132
133
134perl v5.34.0 2021-07-22 Fsdb::Filter::dbrowcount(3)