DB_TO_CSV(1)

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

πŸ’… db_to_csv(1) β€” like, the manual page, bestie ✨

Okay so real quick: this is db_to_csv, and it lives in section 1 of the manual (the user commands one 🫢). Perl's own doc tooling ships it under "User Contributed Perl Documentation," which is exactly as glamorous as it sounds. Let's get into it.


🌸 NAME 🌸

db_to_csv β€” it converts fsdb into the comma-separated-value file format. That's the whole gig. Iconic, focused, no notes. πŸ‘‘


✨ SYNOPSIS ✨

    db_to_csv [-C]

That's it. That's the whole invocation. One optional flag. Main character energy honestly. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So you've got an fsdb file just sitting there, and you want it as comma-separated values instead? Say less. db_to_csv converts an existing fsdb file into comma-separated value format. Slay.

  • Input is fsdb format. That's the vibe it eats. πŸ“
  • Output is CSV-format plain text β€” and heads up, it is not fsdb. It's a whole different format, okay? Don't come for me. πŸ’€

πŸŽ€ OPTIONS πŸŽ€

  • -C or <--omit-comments> β€” also strips out all the comments. Every last one. Gone. Bye bestie. πŸ™ˆ

Also, this module supports all the standard fsdb options, which I will now list in full because I would never leave you hanging:

  • -d β€” turns on debugging output. For when you're like "why is this happening" and you need the receipts. πŸ”₯
  • -i or --input InputSource β€” reads from InputSource. Usually that's a file name, or - for standard input, or (if you're in Perl) IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. Flexible queen. 🌈
  • -o or --output OutputDestination β€” writes to OutputDestination. Usually a file name, or - for standard output, or (if you're in Perl) IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. Same energy, output side. πŸ’œ
  • --autorun or --noautorun β€” by default, programs just process automatically, no prompting. But Fsdb::Filter objects in Perl do not run until you invoke the run() method. This option controls that behavior within Perl. So like, the vibes differ depending on whether you're in Perl or not. Ngl, important. ⭐
  • --help β€” shows help. Short and sweet. 🫢
  • --man β€” shows the full manual. Hi, you're reading it. 😭

🌟 SAMPLE USAGE 🌟

πŸ’– Input:

            #fsdb -F S paper papertitle reviewer reviewername score1 score2 score3 score4 score5
            1  test, paper  2  Smith  4  4  -  -  -
            2  other paper  3  Jones  3  3  -  -  -
            2  input double space  3  Jones  3  3  -  -  -
            #  | csv_to_db

πŸŽ€ Command:

        cat data.fsdb | db_to_csv

πŸ¦‹ Output:

            paper,papertitle,reviewer,reviewername,score1,score2,score3,score4,score5
            1,"test, paper",2,Smith,4,4,-,-,-
            2,"other paper",3,Jones,3,3,-,-,-
            2,"input double space",3,Jones,3,3,-,-,-
            #  | csv_to_db
            #  | db_to_csv

Notice how "test, paper" and "other paper" and "input double space" get quoted because they've got commas and spaces in them? That's the CSV format doing its thing. Chef's kiss. πŸ‘‘


πŸ’€ SEE ALSO πŸ’€

Fsdb. dbfilealter. csv_to_db β€” that last one's the round trip, iykyk. πŸ”


Copyright (C) 2007-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. πŸ“œ


Fr fr, that's the whole page. Nothing skipped, nothing invented. Periodt. πŸ’…

Okay bye bestie β€” this gem came from perl v5.32.1 and got stamped 2024-08-02, so if you're citing it, that's your receipt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from