Skip to content

Array of objects howto #18

@jas-

Description

@jas-

Morning,

Thanks for a great shell only library. I am looking at the docs on using the jb @./file:{} functionality to generate valid JSON structures.

How can I use this to generate an array of objects from a file that is structured like the following:

key=value,item=foo,bar=baz
key=123,item=456,bar=zxy
key=tango,item=uniform,bar=bravo

To something like the following

[
  {
     "key":"value",
     "item":"foo",
     "bar":"baz"
  },
  {
     "key":"123",
     "item":"456",
     "bar":"zxy"
  },
  {
     "key":"tango",
     "item":"uniform",
     "bar":"bravo"
  }
]

Some benchmarking may have put this beyond reach as on a hundred records, using jb @./file:{} took 71minutes to complete. Provided this was in a resource constrained VM. Maybe this functionality is a limit for the shell however.

Thanks for any pointers on how to accomplish this.

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