DBFILEDIFF(1)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

πŸ’… 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 of 1 if some differences were found. (by default, the exit status is 0 with 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 Unix diff(1), where -q suppresses 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, --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, --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, --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. (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. πŸ‘‘


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