Skip to content

[feature request] Handle recfiles like yaml #2242

Description

@Andonome

Thanks for the excellent tool, John.

Could recutils be treated more like YAML, with 'sub-values'?

Extending sample2.rec:

%rec: Book
%doc: A book in my personal collection.

Title: GNU Emacs Manual
Author: Richard M. Stallman
Topic: Ediff
Topic: ERC
Topic: ERT

Converting this to YAML, the expected result would be:

    $ mlr --irecutils --oyaml cat sample2.rec

- Title: GNU Emacs Manual
  Author: Richard M. Stallman
  Topic:
    - Ediff
    - ERC
    - ERT

But the actual result looks like the output of rec2csv:

  - Title: GNU Emacs Manual
    Author: Richard M. Stallman
    Topic: Ediff
    Topic_2: ERC
    Topic_3: ERT

Miller can sort-of parse it with rename already:

	$ mlr --irecutils --oyaml \
	rename -r '"Topic$",Topic_1'\
	then rename -r '"_",.' \
	then cat book.rec

...but this does not feel tidy, and requires stating the field's name up-front.


Fully rendered Recfiles would be great, as it's the only plain-text and git-friendly relational database.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions