Fsdb::F...sv_to_db(3)

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

okay bestie, welcome to the Fsdb::F...sv_to_db(3) page from the User Contributed Perl Documentation β€” it’s giving β€œCSV goes in, fsdb comes out,” and we’re gonna get through it together πŸ’–

✨ NAME ✨

csv_to_db β€” convert comma-separated-value data into fsdb. That’s the whole assignment, no cap.

🌸 SYNOPSIS 🌸

csv_to_db <source.csv

πŸ¦‹ DESCRIPTION πŸ¦‹

Converts a comma-separated-value data stream to Fsdb format. Literally the main character move of this whole program.

The input is CSV-format (not fsdb, bestie β€” don’t get it twisted). The first row is taken to be the names of the columns, so that row is doing important label duty.

The output is two-space-separated fsdb. (Someday more general field separators should be supported.) Fsdb fields are a normalized version of the CSV file: spaces are converted to single underscores. Slay, normalization.

πŸ’… OPTIONS πŸ’…

  • -F, --fs, --fieldseparator S β€” Specify the field (column) separator as S. See dbfilealter for valid field separators. Default is S (double space).

This module also supports the standard fsdb options:

  • -d β€” Enable debugging output. Detective mode: on.
  • -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. We love a quick assist.
  • --man β€” Show full manual. You are here, bestie.

πŸŽ€ SAMPLE USAGE πŸŽ€

🌈 Input:

paper,papertitle,reviewer,reviewername,score1,score2,score3,score4,score5

1,"test, paper",2,Smith,4,4,,,
2,other paper,3,Jones,3,3,,,

🌟 Command:

csv_to_db

πŸ’– Output:

#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  -  -  -
#  | csv_to_db

πŸ”₯ SEE ALSO πŸ”₯

Go check out Fsdb. And also db_to_csv β€” the other direction of the pipeline friendship, iykyk.

πŸ‘‘ CLASS FUNCTIONS πŸ‘‘

🧚 new

$filter = new Fsdb::Filter::csv_to_db(@arguments);

Create a new csv_to_db object, taking command-line arguments. Fresh object, fresh vibes.

πŸ“ set_defaults

$filter->set_defaults();

Internal: set up defaults. Somebody has to do the behind-the-scenes work.

πŸ¦‹ parse_options

$filter->parse_options(@ARGV);

Internal: parse command-line arguments. Reading the room, option-style.

🌸 setup

$filter->setup();

Internal: setup, parse headers. Getting the whole situation organized.

⭐ run

$filter->run();

Internal: run over each rows. Row by row, we move.

Copyright (C) 1991-2008 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! cute little sign-off: perl v5.32.1, date 2024-08-02, page Fsdb::F...sv_to_db(3) β€” periodt πŸ’–βœ¨

πŸ“¦ where this page comes from