Fsdb::F...ttorows(3)

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

πŸ’– 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 column N for enumeration. defaults to "index". ✨
  • -e E, --empty E β€” give value E as the value for empty (null) records. πŸ’œ

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. πŸ”₯
  • --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. πŸƒβ€β™€οΈ

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