DBCOLSPLITTOROWS(1)
π DBCOLSPLITTOROWS(1) β dbcolsplittorows, aka the glow-up column splitter π
okay bestie, sit down because this little icon does ONE thing and it does it flawlessly: it takes a column you already have and β¨splitsβ¨ it into a bunch of new rows. the manpage name is dbcolsplittorows and yes it's part of the Fsdb fam. no cap, it's giving "divide and conquer" energy.
β¨ SYNOPSIS β¨
dbcolsplittorows [-C ElementSeperator] [-e null] [-E] [-N
enumerated-name] column [column...]
literally that's it. hand it a column (or several, go off π) and it does the thing.
πΈ DESCRIPTION πΈ
So here's the vibe: you point it at column, it splits that column into pieces, and then it outputs one row for each piece. simple as that, fr fr.
By default, any empty fields are ignored β like, they don't get an invite to the party π. But if you do pass an empty field value with -e, then they produce output. so it's your call, bestie.
When a null value is given, empty fields at the beginning and end of lines are suppressed (think of it like how perl split behaves πͺ). But β and this is the plot twist β unlike perl, if ALL fields are empty, we generate one (and not zero) empty fields. yes, one. always at least one. the show must go on π.
And the inverse of this command is dbfilepivot. so if you ever need to go backwards, you know where to find it π«Ά.
π OPTIONS π
-CS or--element-separatorS β specify the separator used to split columns. (defaults to a single underscore_, iconic and lowkey)-Eor--enumerateβ enumerate output columns! instead of assuming the column name uses the element separator, we keep it whole and fill in with indexes starting from 0. numbers go brrr π’-Nor--new-nameN β name the new column N for enumeration. defaults to"index"β¨-eE or--emptyE β give value E as the value for empty (null) records π«
This module also supports the standard fsdb options:
-dβ enable debugging output. π-ior--inputInputSource β read from InputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--outputOutputDestination β write to OutputDestination, typically a file name, or"-"for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--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. π₯--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
see how John_Heidemann became two whole rows?? that underscore said "my time has come" and dipped π. Root had no underscore so it stayed exactly as it was β main character energy, no split needed.
π SEE ALSO π
Fsdb(1). dbcolmerge(1). dbcolsplittocols(1). dbcolrename(1). dbfilepvot(1).
like, go read those too. they're friends of the family π«Ά
π 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. βοΈ
okay that's the whole page, bestie, you're officially an expert π§β¨ β and for the record, this slay was brought to you by perl v5.32.1, dated 2024-08-02, and it's DBCOLSPLITTOROWS(1) all day every day. periodt π
π
π¦ 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