dbrowdiff - Man Page
compute row-by-row differences of some column
Synopsis
dbrowdiff [-B|-I|-F] [-A AbsDiffColumnName] [-P PctDiffColumnName] column
Description
For a given column, compute the differences between each row of the table. Differences are output to two new columns, absdiff
and pctdiff
.
Differences are either relative to the previous column (incremental mode), or relative to the first row (baseline mode), the default. Alternatively, in future mode, differences are between the next row and the current row.
If column names are given, with -A
or -P
, then only columns with that name are produced.
Options
- -B or --baseline
Select baseline mode (the default), where differences are relative to the first row.
- -I or --incremental
Select incremental mode, where differences are relative to the previous row.
- -F or --future
Select future incremental mode, where differences are incremental between the next row and the current one.
- -A COL or --absdiff COL
Name the absolute difference output column COL, and don't output percent difference unless
-P
is given.- -P COL or --pctdiff COL
Name the percent difference output column COL, and don't output absolute difference unless
-P
is given.- -f FORMAT or --format FORMAT
Specify a printf(3)-style format for output statistics. Defaults to
%.5g
.- -e EmptyValue or --empty
Specify the value for the last row when in future mode.
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.- --help
Show help.
- --man
Show full manual.
Sample Usage
Input
#fsdb event clock:d _null_getpage+128 815812813.281756 _null_getpage+128 815812813.328709 _null_getpage+128 815812813.353830 _null_getpage+128 815812813.357169 _null_getpage+128 815812813.375844 _null_getpage+128 815812813.378358 # | /home/johnh/BIN/DB/dbrow # | /home/johnh/BIN/DB/dbcol event clock
Command
cat DATA/kitrace.fsdb | dbrowdiff clock
Output
#fsdb event clock:d absdiff:d pctdiff:d _null_getpage+128 815812813.281756 0 0 _null_getpage+128 815812813.328709 0.046953 5.7554e-09 _null_getpage+128 815812813.353830 0.072074 8.8346e-09 _null_getpage+128 815812813.357169 0.075413 9.2439e-09 _null_getpage+128 815812813.375844 0.094088 1.1533e-08 _null_getpage+128 815812813.378358 0.096602 1.1841e-08 # | /home/johnh/BIN/DB/dbrow # | /home/johnh/BIN/DB/dbcol event clock # | dbrowdiff clock
See Also
Fsdb. dbcolmovingstats. dbrowuniq. dbfilediff.
dbrowdiff, dbrowuniq, and dbfilediff are similar but different. dbrowdiff computes row-by-row differences for a column, dbrowuniq eliminates rows that have no differences, and dbfilediff compares fields of two files.
AUTHOR and COPYRIGHT
Copyright (C) 1991-2024 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.