Parser for generic ASCII tables.
See original GitHub issueI have a few tools I use that output their data as ASCII tables in various formats. An example would be the virsh
commnad line interface:
$ virsh pool-list --all
Name State Autostart
-----------------------------------
default active no
disk-images active yes
vmdisk active yes
The issue is that virsh
alone has hundreds of commands which output different columns. Some of those commands even allow selectively hiding or including specific columns in the output.
I’d like to parse the output of these but I don’t know that it makes sense to write a parser for each one or even for each of these programs. What if we added a generic ASCII table parser instead that could handle some common output formats? As an example here’s a short Python 3 script I wrote as a first pass at this: https://github.com/CtrlC-Root/dotfiles/blob/master/bin/tj. Would something like this make sense to add to this project?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
This is fantastic! I’ve wanted to pick this back up but I just haven’t found the time to even respond here much less work on it. I have a script that parses virsh output well enough and I’ve just been using that but I look forward to dropping it once this is implemented.
asciitable
andasciitable-m
parsers have been released with jc v1.18.6