Fsdb::F...ttorows(3)
π NAME π
okay so this is Fsdb::F...ttorows(3), from the User Contributed Perl Documentation, and it's the page for dbcolsplittorows β split an existing column into multiple new rows. bestie, that's the name section and it ate. π
β¨ SYNOPSIS β¨
dbcolsplittorows [-C ElementSeperator] [-e null] [-E] [-N
enumerated-name] column [column...]
π¦ DESCRIPTION π¦
okay so the main character energy here: split column into pieces, and output one row for each piece. highkey literally one piece, one row. the way that works is lowkey the whole vibe. π
By default, any empty fields are ignored β periodt. if an empty field value is given with -e, then they produce output. π
When a null value is given, empty fields at the beginning and end of lines are suppressed (like perl split). unlike perl, if ALL fields are empty, we generate one (and not zero) empty fields. no cap, that's the little twist. π
The inverse of this commend is dbfilepivot. iykyk β and yes, "commend" is exactly what the page says, so i'm preserving that fr fr. π«Ά
πΈ OPTIONS πΈ
-C S,--element-separator Sβ specify the separator used to split columns. (defaults to a single underscore.) π-E,--enumerateβ enumerate output columns: rather than assuming the column name uses the element separator, we keep it whole and fill in with indexes starting from 0. β-N,--new-name Nβ name the new columnNfor enumeration. defaults to"index". β¨-e E,--empty Eβ give valueEas the value for empty (null) records. π
This module also supports the standard fsdb options:
-dβ enable debugging output. π-i,--input InputSourceβ read fromInputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. π-o,--output OutputDestinationβ write toOutputDestination, 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. π₯--helpβ show help. π--manβ show full manual. π
π SAMPLE USAGE π
π₯ Input:
#fsdb name uid
John_Heidemann 2274
Greg_Johnson 2275
Root 0
# this is a simple database
# | dbcol fullname uid
# | dbcolrename fullname name
β¨οΈ Command:
cat data.fsdb | dbcolsplittorows name
π€ Output:
#fsdb name uid
John 2274
Heidemann 2274
Greg 2275
Johnson 2275
Root 0
# this is a simple database
# | dbcol fullname uid
# | dbcolrename fullname name
# | dbcolsplittorows name
that output is giving slay and i'm obsessed. π
π§ SEE ALSO π§
Fsdb(1). dbcolmerge(1). dbcolsplittocols(1). dbcolrename(1). dbfilepvot(1). (that last one is spelled exactly like that on the page, bestie π«Ά)
π CLASS FUNCTIONS π
new
$filter = new Fsdb::Filter::dbcolsplittocols(@arguments);
Create a new dbcolsplittocols object, taking command-line arguments. not me noticing it says dbcolsplittocols here β preserving it exactly, ngl π
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) 1991-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. π
π and that's the whole page! source/version: perl v5.32.1 Β· date: 2024-08-02 Β· page: Fsdb::F...ttorows(3). bye bestie, go split some columns π
π¦ 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