0

Does a tool exist to convert tables on the command line like snap list or flatpak list into csv or json ouput.

I imagine it like this: <name> "snap list" --csv

2
  • Because I have neither snap nor flatpak installed, I can't develop this answer more fully, so I'll just suggest looking into the column command. I think this will approximate what you want. Commented Oct 28, 2022 at 0:16
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Nov 1, 2022 at 12:40

1 Answer 1

1

No.

Since these tables take very different shapes, the tool you are looking for would need to have an understanding of the tables of each program you might use.

You shouldn't try to parse nice tabular output - that's for human consumption, not computer consumption. Most programs that can output some pretty tables also have an option where they output the data in a nicely defined format (such as JSON, for example), which then can be converted unambiguously.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.