DBCOLMERGE(1)

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

πŸ’… DBCOLMERGE(1) β€” bestie's guide to merging columns πŸ’…

okay so this is a page from the User Contributed Perl Documentation collection, and it's about a little tool called dbcolmerge and honestly? it's a whole vibe. let's get into it 🫢


✨ NAME ✨

dbcolmerge β€” merge multiple columns into one. that's it. that's the girl. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

dbcolmerge [-C ElementSeparator] [columns...]

🌸 DESCRIPTION 🌸

okay so picture this: for each row, dbcolmerge merges multiple columns down to a single column β€” and it's always a string, no exceptions, that's just the rules bestie β€” joining the elements with ElementSeparator, which defaults to a single underscore (_). lowkey iconic, highkey useful. ✨


πŸ’… OPTIONS πŸ’…

  • -C S or --element-separator S β€” specify the separator used to join columns. (defaults to a single underscore.) πŸŽ€
  • -e E or --empty E β€” give value E as the value for empty (null) records. no more awkward blank energy πŸ’€

This module also supports the standard fsdb options, and yes we're listing all of them, come on now πŸ‘‘

  • -d β€” enable debugging output. πŸ›
  • -i or --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 or --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 or --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. 🧚
  • --header H β€” use H as the full Fsdb header, rather than reading a header from then input. (yes, "then input", the manpage said what it said, we respect the original ✍️)
  • --help β€” show help. 🫢
  • --man β€” show full manual. the one you're reading rn, meta ik 😭

⭐ SAMPLE USAGE ⭐

🌼 Input:

#fsdb      first   last
John    Heidemann
Greg    Johnson
Root    -
# this is a simple database
#  | /home/johnh/BIN/DB/dbcol fullname
#  | dbcolrename fullname first_last
#  | /home/johnh/BIN/DB/dbcolsplit -C _ first_last
#  | /home/johnh/BIN/DB/dbcol first last

🌼 Command:

cat data.fsdb | dbcolmerge -C _ first last

🌼 Output:

#fsdb      first   last    first_last
John    Heidemann       John_Heidemann
Greg    Johnson Greg_Johnson
Root    -        Root_
# this is a simple database
#  | /home/johnh/BIN/DB/dbcol fullname
#  | dbcolrename fullname first_last
#  | /home/johnh/BIN/DB/dbcolsplit first_last
#  | /home/johnh/BIN/DB/dbcol first last
#  | /home/johnh/BIN/DB/dbcolmerge -C _ first last

like look at that β€” John + Heidemann = John_Heidemann, slay. and Root with a - becomes Root_ because the empty side just... doesn't show up. ate and left no crumbs πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

Fsdb. dbcolsplittocols. dbcolsplittorows. dbcolrename.

(the whole friend group, honestly πŸ‘―β€β™€οΈ)


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. πŸ“œ


kay that's the whole thing, hope it ate πŸ’– this page came to you courtesy of perl v5.32.1, dated 2024-08-02, and it's the DBCOLMERGE(1) page β€” go merge some columns bestie, ily, bye πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from