DBFILEALTER(1)
π 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 π
-For--fsor--fieldseparatorSβ sets the field (column) separator toS. valid field separators are listed below, keep reading bestie π«Ά-Ror--rsor--rowseparatorSβ sets the row separator toS. valid row separators are also below β¬οΈ-Zor--compressionSβ sets file compression using the file extensionS. the supported compressions aregzfor gzip,bz2for bzip2,xzfor xz, ornoneorundefto disable compression. default isnone. no cap. π-cor--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 π-ior--inputInputSourceβ read fromInputSource, which is typically a file name, or-for standard input, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. flexible much? π-oor--outputOutputDestinationβ write toOutputDestination, typically a file name, or-for standard output, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. same energy, output side π--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the--(no)autorunoption 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β takeNas 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β takeAas a one (unicode) literal character. accepts one or more of those characters on input, outputs exactly one of those characters.
potentially in the futurexNandcAwill support single-character-on-input equivalents ofXNand<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. likeC, 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 π«Ά
π AUTHOR and COPYRIGHT π
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
- 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