M
M
mr_creo2017-05-29 15:23:15
Perl
mr_creo, 2017-05-29 15:23:15

Dynamic table output to STDOUT?

Good afternoon, tell me how to organize the output of a dynamic table in STDOUT?
Once every 3 seconds, the script dumps its current values ​​to STDOUT, now it looks like this:

col1: 123 col2 123 col3: 234
col1: 123 col2 123 col3: 234
col1: 123 col2 123 col3: 234

I would like to see the table like this:
|   123 |   234 |   345 |   456 |   567 |   678 |   789 |
|   123 |   234 |   345 |   456 |   567 |   678 |   789 |
|   123 |   234 |   345 |   456 |   567 |   678 |   789 |
|   123 |   234 |   345 |   456 |   567 |   678 |   789 |
тут новые значения
+-------+-------+-------+-------+-------+-------+-------+
|  col1 |  col2 |  col3 |  col4 |  col5 |  col6 |  col7 |
+-------+-------+-------+-------+-------+-------+-------+

and the names of the columns at the bottom.
I'm looking for advice and ideas.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Leonid Nikolaev, 2017-06-08
@nikonor

perldoc -f format ?

V
Vladimir Varlamov, 2018-01-26
@bes_internal

I think https://metacpan.org/pod/Text::ASCIITable is the right direction

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question