Created
September 27, 2012 21:42
-
-
Save smerritt/3796627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Parse the output of lnstat(8) into something perhaps slightly | |
# human-readable. | |
# | |
# Can take input from a file or on stdin. | |
import sys | |
lnstat_output = open(sys.argv[1]) if len(sys.argv) >= 2 else sys.stdin | |
table = [line.split('|') for line in lnstat_output] | |
for i in xrange(len(table[0])): | |
print " | ".join([row[i].strip() for row in table]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment