DBFILEALTER(1)

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

πŸ’… DBFILEALTER πŸ’…

okay so real quick, the manual name is dbfilealter(1) and it's this iconic little Perl number that lives in the User Contributed Perl Documentation section ✨ bestie, if you've ever wanted to change how an Fsdb file separates its stuff, this is literally your girl. πŸŽ€


🌸 NAME 🌸

dbfilealter β€” the glow-up artist for your Fsdb file's format. it goes in and switches around the row separator and/or the column separator. that's the whole vibe check. πŸ’–


✨ SYNOPSIS ✨

dbfilealter [-c] [-F fs] [-R rs] [-Z compression] [column...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this program reformats an Fsdb file by changing the row separator (-R rs) or the column separator (-F fs). not me being dramatic, that's just what it does. πŸ”₯

and it's not reckless about it β€” it verifies that this action doesn't violate the file constraints (like, imagine spaces showing up in your data and your new format uses space as a separator?? disaster πŸ’€), and it can optionally correct things for you.

if you hand it -Z compression, it controls the compression on the file too. iconic. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -F or --fs or --fieldseparator S β€” sets the field (column) separator to S. valid field separators are listed below, keep reading bestie 🫢
  • -R or --rs or --rowseparator S β€” sets the row separator to S. valid row separators are also below ⬇️
  • -Z or --compression S β€” sets file compression using the file extension S. the supported compressions are gz for gzip, bz2 for bzip2, xz for xz, or none or undef to disable compression. default is none. no cap. 🌈
  • -c or --correct β€” corrects any inconsistency caused by the new separators, if possible. keyword: if possible 😭

this module also supports the standard fsdb options, which are:

  • -d β€” turns on debugging output. very demure, very informative πŸ›
  • -i or --input InputSource β€” read from InputSource, which is typically a file name, or - for standard input, or (if you're in Perl) IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. flexible much? πŸ’œ
  • -o or --output OutputDestination β€” write to OutputDestination, typically a file name, or - for standard output, or (if you're in Perl) IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. same energy, output side πŸ“
  • --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. iykyk 🧚
  • --help β€” shows help. we love a quick lil summary πŸ’«
  • --man β€” shows the full manual. that's this, hi, welcome 🌸

🌟 Valid Field Separators 🌟

  • D β€” default: any amount of whitespace on input, tabs on output.
  • s β€” single space (exactly one space for input and output).
  • S β€” double space on output; two or more spaces on input.
  • t β€” single tab character (exactly one tab for input and output).
  • XN β€” take N as one or more hex digits that specify a unicode character. accepts one or more of those characters on input, outputs exactly one of those characters.
  • CA β€” take A as a one (unicode) literal character. accepts one or more of those characters on input, outputs exactly one of those characters.
potentially in the future xN and cA will support single-character-on-input equivalents of XN and <CA>. that's a future thing, not a now thing. ⏳

πŸŽ€ Valid Row Seperators πŸŽ€

three row separators are allowed, and yes i'm listing all three:

  • D β€” the default, one line per row.
  • C β€” complete rowized. each line is a field-labeled and its value, and a blank line separates "rows". all fields present in the output.
  • I β€” incompletely rowized. like C, but null fields are omitted from the output.

πŸ”₯ SAMPLE USAGE πŸ”₯

input:

#fsdb name id test1
a 1 80
b 2 70
c 3 65

command:

cat data.fsdb | dbfilealter -F S

output:

#fsdb -F S name id test1
a  1  80
b  2  70
c  3  65
#  | dbfilealter -F S

command 2:

cat data.fsdb | dbfilealter -R C

output:

#fsdb -R C name id test1
name: a
id: 1
test1: 80

name: b
id: 2
test1: 70

name: c
id: 3
test1: 65

#   | dbfilealter -R C

correction mode input:

#fsdb -F S name id test1
a student  1  80
b nice  2  70
c all  3  65

correction mode command:

cat correction.fsdb | dbfilealter -c -F D

correction mode output:

#fsdb name id test1
a_student   1       80
b_nice      2       70
c_all       3       65
#   | dbfilealter -c -F D

see how the -c version just handled the space situation?? that's the correction mode slay πŸ’…βœ¨


πŸ’– SEE ALSO πŸ’–

Fsdb, dbcoldefine. go give them a visit, they're friends of the family 🫢


copyright (C) 2008-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, no notes πŸ’œ run it, love it, reformat your separators responsibly. this little gem is perl v5.32.1, dated 2024-08-02, and it's the DBFILEALTER(1) page β€” mwah, go forth and separate your fields correctly πŸŒˆπŸŽ€

πŸ“¦ where this page comes from