YAML_TO_DB(1)
π yaml_to_db(1) π
okay so bestie, welcome to the yaml_to_db page π β it's from the User Contributed Perl Documentation section (section 1 of the manual, iykyk), and honestly? it's giving tiny-but-mighty.
β¨ NAME β¨
yaml_to_db β converts a subset of YAML into fsdb. like, a very specific subset. not all of YAML. we'll get there π
πΈ SYNOPSIS πΈ
yaml_to_db <source.yaml
literally that's it. she reads from stdin, she writes to stdout, she slays β¨
π¦ DESCRIPTION π¦
So here's the vibe: this thing converts a very limited subset of YAML into Fsdb format. limited limited. don't come in here with your fancy full YAML spec, she will not cope π
The input is YAML-format (not fsdb β important distinction, ngl). It gets parsed as YAML, and the assumption is that the file is an array of dictionary entries. We extract the dictionary names and output that as an fsdb table. cute, right?
We also flatten one level of lists into comma-separated values. one level. that's the deal π«Ά
The output is tab-separated fsdb. And yes, before you ask: "Someday more general field separators should be supported." β that's straight from the source, bestie, that's a someday problem π
π OPTIONS π
This module also supports the standard fsdb options, so let's go through them one by one, no skipping, we don't do that here π
-dβ enable debugging output. turn it on when things are being weird π-ior--inputInputSource β read from InputSource, which is typically a file name, or"-"for standard input, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. very flexible, we love her π-oor--outputOutputDestination β write to OutputDestination, typically a file name, or"-"for standard output, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects. same energy, output edition π--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. iykyk π§--helpβ show help. be nice to her π₯Ί--manβ show the full manual. you're literally reading it bestie π
π SAMPLE USAGE π
π Input:
- name: ACM
role: sponsor
alttext: ACM, the Association for Computing Machinery
image: logos/acm-small.jpg
link: https://www.acm.org/
date: 2016-01-01
- name: SIGCOMM
role: sponsor
alttext: SIGCOMM, ACM'S Special Interest Group on Communication
image: logos/sigcommlogo.png
link: http://sigcomm.org
date: 2016-01-02
- name: SIGMETRICS
role: sponsor
alttext: SIGMETRICS, ACM'S Special Interest Group on Performance Evaluation
image: logos/sigmetrics-small.png
link: http://www.sigmetrics.org
date: 2016-01-03
π Command:
yaml_to_db <gnupod.yaml
β Output:
#fsdb -F t alttext date image link name role
ACM, the Association for Computing Machinery 2016-01-01 logos/acm-small.jpg https://www.acm.org/ ACM sponsor
SIGCOMM, ACM'S Special Interest Group on Communication 2016-01-02 logos/sigcommlogo.png http://sigcomm.org SIGCOMM sponsor
SIGMETRICS, ACM'S Special Interest Group on Performance Evaluation 2016-01-03 logos/sigmetrics-small.png http://www.sigmetrics.org SIGMETRICS sponsor
# | yaml_to_db
see how the field names got alphabetized into that #fsdb -F t ... header line? iconic behaviour, honestly π
π SEE ALSO π
Fsdb. that's the whole list. go read it if you want the full fsdb lore π
π AUTHOR and COPYRIGHT π
Copyright (C) 2011-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. open source queen π
ngl bestie, the whole "limited subset of YAML" thing is the main character energy of this page β don't expect her to handle every YAML file you throw at her, and definitely don't expect configurable separators yet. someday. someday π
perl v5.32.1 Β· 2024-08-02 Β· YAML_TO_DB(1) β that's the version, the date, and the page name, all wrapped up with a lil bow π bye bestie, go convert some YAML πβ¨π¦
π¦ 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