onyo tsv-to-yaml

Convert a TSV file into YAML suitable to pass to onyo new and onyo set.

The header declares the key names to be populated. The values to populate documents are declared with one line per YAML document.

The output is printed to stdout as a multiple document YAML file (each document is separated by a --- line).

usage: onyo tsv-to-yaml [-h] TSV

Positional Arguments

TSV

Path of tabular file to convert to YAML.

Examples

$ onyo tsv-to-yaml table.tsv

The resulting multi-document YAML file can be split into multiple YAML files (if desired) using csplit.

$ onyo tsv-to-yaml table.tsv | csplit -z --suffix-format '%04d.yaml' - "/---/" "{*}"