Fsdb::F...ilealter(3)
π NAME π
Okay bestie, meet dbfilealter β the Fsdb glow-up tool that alters the format of an Fsdb file by changing the row/column separator. This page is Fsdb::F...ilealter(3) from the Perl user-contributed docs, and it is literally giving "make my separators make sense" energy π
β¨
dbfilealter β alter the format of an Fsdb file, changing the row/column separator.
β¨ SYNOPSIS β¨
dbfilealter [-c] [-F fs] [-R rs] [-Z compression] [column...]
π¦ DESCRIPTION π¦
Okay so this program reformats a Fsdb file, altering the row separator (-R rs) or the column separator (-F fs). It verifies that this action does not violate the file constraints β for example, if spaces appear in data and the new format has space as a separator β and it can optionally correct things. β¨
With -Z compression it controls compression on the file. π«Ά
π OPTIONS π
-F,--fs,--fieldseparator Sβ specify the field (column) separator asS. See below for valid field separators. πΈ-R,--rs,--rowseparator Sβ specify the row separator asS. See below for valid row separators. π-Z,--compression Sβ specify file compression as given by file extensionS. Supported compressions aregzfor gzip,bz2for bzip2,xzfor xz, ornoneorundefto disable compression. Default is none. π-c,--correctβ correct any inconsistency caused by the new separators, if possible. π οΈ
This module also supports the standard fsdb options, no cap:
-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)autorunoption controls that behavior within Perl. π€--helpβ show help. π--manβ show full manual. π
π 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. Accept one or more of those characters on input, output exactly one of those characters. π₯CAβ takeAas a one (unicode) literal character. Accept one or more of those characters on input, output exactly one of those characters. πΈ
Potentially in the future xN and cA will support single-character-on-input equivalents of XN and <CA>. π
π Valid Row Seperators π
Three row separators are allowed, bestie:
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 ALSO π¦
Fsdb, dbcoldefine.
π CLASS FUNCTIONS π
π new π
$filter = new Fsdb::Filter::dbfilealter(@arguments);
Create a new dbfilealter object, taking command-line arguments. β¨
πΈ set_defaults πΈ
$filter->set_defaults();
Internal: set up defaults.
π¦ parse_options π¦
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
β setup β
$filter->setup();
Internal: setup, parse headers.
π« run π«
$filter->run();
Internal: run over each rows.
π 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. π
Sign-off tea β: this page is from perl v5.32.1, dated 2024-08-02, and it lives at Fsdb::F...ilealter(3). Bye bestie, go slay those separators π
β¨
π¦ 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