DBCOLSPLITTOCOLS(1)
π dbcolsplittocols β DBCOLSPLITTOCOLS(1) π
okay bestie, gather round: this is a User Contributed Perl Documentation page for dbcolsplittocols, aka DBCOLSPLITTOCOLS(1). It's giving main character energy, it ate, and the vibe check says: split one column into several new ones. No cap. π
β¨ SYNOPSIS β¨
dbcolsplittocols [-E] [-C ElementSeparator] column
πΈ DESCRIPTION πΈ
Create new columns by splitting an existing column. The fragments of the column are each divided by ElementSeparator (default is underscore).
This command is literally the opposite of dbcolmerge. Names of the new columns are given by splitting the name of the existing column. dbcolrename may be useful to set column names.
Input treated as strings and output columns are of type string. fr fr.
π OPTIONS π
π¦ the dbcolsplittocols-specific ones π¦
-C Sor--element-separator Sβ specify the separatorSused to join columns. Usually a single character, it can also be a regular expression (so, for example,[,_]matches either,or_as an element separator). Defaults to a single underscore.-Eor--enumerateβ enumerate output columns: rather than assuming the column name uses the element separator, we keep it whole and fill in with indexes starting from0. Not currently implemented, but planned. Seedbcolsplittorows.-N on --new-nameβ specify the names of the new columns as a space separated list. Default is to apply the separator to the name of the column that is being split. (The original really printsonhere, notorβ we're keeping it exactly as printed π.)
By default, column "a_b" will split to columns a and b. If the column is given as ab with option "-N 'a b'", one will get the same result.
-Eor--enumerateβ enumerate output columns: rather than assuming the column name uses the element separator, we keep it whole and fill in with indexes starting from0. Not currently implemented, but planned. Seedbcolsplittorows.
bestie, yes,-E/--enumerateis literally listed twice in the original. We're keeping both so nothing gets lost π .
π standard fsdb options π
This module also supports the standard fsdb options:
-dβ enable debugging output.-ior--input InputSourceβ read fromInputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--output OutputDestinationβ write toOutputDestination, 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)autorun"option controls that behavior within Perl.--header Hβ useHas the full Fsdb header, rather than reading a header from the input.--helpβ show help.--manβ show full manual.
π SAMPLE USAGE π
π₯ Input:
#fsdb first_last
John_Heidemann
Greg_Johnson
Root
# this is a simple database
# | dbcolrename fullname first_last
# | /home/johnh/BIN/DB/dbcol first_last
πͺ Command:
cat data.fsdb | dbcolsplittocols first_last
π€ Output:
#fsdb first_last first last
John_Heidemann John Heidemann
Greg_Johnson Greg Johnson
Root Root
# this is a simple database
# | dbcolrename fullname first_last
# | /home/johnh/BIN/DB/dbcol first_last
# | /home/johnh/BIN/DB/dbcolsplittocols first_last
π SEE ALSO π
Fsdb(3). dbcolmerge(1). dbcolsplittorows(1). dbcolrename(1).
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2022 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.
mwah π this page is from perl v5.32.1, dated 2024-08-02, and yes bestie it's the DBCOLSPLITTOCOLS(1) manual. 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