DBFILEDIFF(1)
π NAME π
okay so dbfilediff β it compares two fsdb tables, bestie. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
dbfilediff [-Eq] [-N diff_column_name] --input table1.fsdb --input table2.fsdb
OR
cat table1.fsdb | dbfilediff [-sq] --input table2.fsdb
π DESCRIPTION π
so Dbfilediff compares two Fsdb tables, row by row. and no, it is not giving Unix diff(1) β this program assumes the files are identical line-by-line and we compare fields instead. which means the moment somebody inserts one extra row, literally every row after it gets marked different. no cap. π like, one rogue row and the whole rest of the table is wearing the wrong outfit.
by default, all columns must be unique. (and at some point, support to specific specific columns may be added β that's the tea for now, don't ask me when.)
the output is a brand new table with a brand new column called "diff" (or literally anything else if you pass the -N option). the values? "-" and "+" mark the first and second non-equal rows, "=" means the lines match, and "~" means they're equal with epsilon numerics (and in that case only the second row gets included). unlike Unix diff(1), we output all the rows (the "=" lines), not just the diffs β the --quiet option suppresses that output if you're not in the mood.
optionally, with -E, it'll do an "epsilon numeric" comparision, so it can handle things like variations in different computers' floating point precision and differences in printf output. it's giving "i forgive you for being off by a crumb" energy. π§
epsilon comparision is asymmetric β it assumes the first input is correct and allows the second input to vary, but not the reverse. the first table is the main character and the second one is just trying to keep up. π
because two tables are required, input is typically in files. standard input is accessible by the file "-".
π₯ OPTIONS π₯
-E,--epsilonβ do that epsilon-numeric comparison thing. (described above, bestie.)- epsilon-comparision is only done on columns that look like floating point numbers β not on strings or integers. it allows the last digit to vary by 1, or for there to be one extra digit of precision, but only for floating point numbers.
- rows that are within epsilon are not considered different for purposes of the exit code. so slay for them.
--exitβ exit with a status of1if some differences were found. (by default, the exit status is0with or without differences, as long as the file is processed successfully. so yes, it's that chill by default.)-N,--new-nameβ specify the name of the"diff"column, if any. (default is"diff".) name your baby whatever you want β¨-q,--quietβ be quiet, suppressing output for identical rows. (and heads up, this behavior is different from Unixdiff(1), where-qsuppresses all output.) if repeated, it also omits epsilon-equivalent rows. π€«
π the standard fsdb options, also supported π
this module also supports the standard fsdb options:
-dβ enable debugging output.-i,--inputInputSource β read from InputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-o,--outputOutputDestination β write to OutputDestination, typically a file name, or"-"for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorun,--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the"--(no)autorun"option controls that behavior within Perl. (very "i'll get to it when i get to it" of them.)--helpβ show help.--manβ show full manual. (you're kind of looking at it rn π)
πΈ SAMPLE USAGE πΈ
π Input:
#fsdb event clock absdiff pctdiff
_null_getpage+128 815812813.281756 0 0
_null_getpage+128 815812813.328709 0.046953 5.7554e-09
_null_getpage+128 815812813.353830 0.025121 3.0793e-09
_null_getpage+128 815812813.357169 0.0033391 4.0929e-10
and over in the file TEST/dbfilediff_ex.in-2:
#fsdb event clock absdiff pctdiff
_null_getpage+128 815812813.281756 0 0
_null_getpage+128 815812813.328709 0.046953 5.7554e-09
_null_getpage+128 815812813.353830 0.025121 3.0793e-09
_null_getpage+128 815812813.357169 0.003339 4.0929e-10
π Command:
cat TEST/dbfilediff_ex.in | dbfilediff -i - -i TEST/dbfilediff_ex.in-2
β Output:
#fsdb event clock absdiff pctdiff diff
_null_getpage+128 815812813.281756 0 0 =
_null_getpage+128 815812813.328709 0.046953 5.7554e-09 =
_null_getpage+128 815812813.353830 0.025121 3.0793e-09 =
_null_getpage+128 815812813.357169 0.0033391 4.0929e-10 -
_null_getpage+128 815812813.357169 0.003339 4.0929e-10 +
# | dbfilediff --input TEST/dbfilediff_ex.in-2
see that last pair? one tiny digit of difference and it's "-" then "+" β the diff column is literally doing a before/after reveal. π
by comparision, if one adds the -s option, then all rows will pass as equal. iconique.
π«Ά SEE ALSO π«Ά
Fsdb. dbrowuniq. dbfilediff.
dbrowdiff, dbrowuniq, and dbfilediff are similar but different, and honestly they each have their own personality: dbrowdiff computes row-by-row differences for a column, dbrowuniq eliminates rows that have no differences, and dbfilediff compares fields of two files. pick your fighter. π
π AUTHOR and COPYRIGHT π
Copyright (C) 2012-2018 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.
aaaand that's the whole page bestie, mwah π this one came from perl v5.32.1, dated 2024-08-02 β go forth and diff those tables, you absolute legend ππ
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms