question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parser for generic ASCII tables.

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
CtrlC-Rootcommented, Mar 23, 2022

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.

0reactions
kellyjonbrazilcommented, Mar 25, 2022

asciitable and asciitable-m parsers have been released with jc v1.18.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASCII Tables (astropy.io.ascii) — Astropy v5.2
astropy.io.ascii provides methods for reading and writing a wide range of ASCII data table formats via built-in Extension Reader Classes.
Read more >
asciitable 0.8.0 documentation
An extensible ASCII table reader and writer for Python 2 and 3. Asciitable can read and write a wide range of ASCII table...
Read more >
ASCII Table Generator - ozh.github.com
Quickly format ASCII table. Great for source code comments and Github Markdown! Input. Create.
Read more >
claudeheintz/lxascii: Java code for parsing USITT ASCII files
The generic AbstractASCII parser class reads and parses a USITT ASCII string. ... class also overrides ParrotASCIIParser and allows you to build a...
Read more >
ASCII Tables Overview - ECMWF Confluence Wiki
ASCII Table data (or just Table data for short) is a generic term for ... is able to properly parse and interpret ASCII...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found