yaml_to_db - Man Page

convert a subset of YAML into fsdb

Synopsis

    yaml_to_db <source.yaml

Description

Converts a very limited subset of YAML into Fsdb format.

The input is YAML-format (not fsdb). The input is parsed as YAML,  assuming the file is an array of dictionary entries. We extract the dictionary names and output this as an fsdb table.

We also flatten one level of lists into comma-separated values.

The output is tab-separated fsdb. (Someday more general field separators should be supported.)

Options

This module also supports the standard fsdb options:

-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.

--help

Show help.

--man

Show full manual.

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 Also

Fsdb.

Info

2024-08-02 perl v5.40.0 User Contributed Perl Documentation