Skip Menu |

This queue is for tickets about the Text-Table CPAN distribution.

Report information
The Basics
Id: 117987
Status: rejected
Priority: 0/
Queue: Text-Table

People
Owner: Nobody in particular
Requestors: dk068x [...] att.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Need more examples
Date: Tue, 20 Sep 2016 15:29:39 +0000
To: "bug-Text-Table [...] rt.cpan.org" <bug-Text-Table [...] rt.cpan.org>
From: "KARR, DAVID" <dk068x [...] att.com>
I was looking at Text::Table for the ability to print out a CSV in ascii text, using the "line-crossings" convention, as is mentioned in the Text::Table doc. Functionally, this looks like what I need, but frankly, I find this doc page to be incomprehensible. You need to add many examples to show how to use these features. You really only have a single complete example at the top of the page. I'm trying to print out text from a CSV like the following: +-----------+------------------------+-----------+----------+---+---+----+ | DC| TIMESTAMP| EVENT_CODE| SUBMITTED| OT| BE| OCE| +-----------+------------------------+-----------+----------+---+---+----+ | Alpharetta| 2016-09-19 00:07:44.172| SUCCESS| 1| 0| 0| 0| | Alpharetta| 2016-09-19 00:10:26.938| SUCCESS| 1| 0| 0| 0| | Alpharetta| 2016-09-19 00:19:42.851| SUCCESS| 1| 0| 0| 0| | Alpharetta| 2016-09-19 00:38:51.395| SUCCESS| 1| 0| 0| 0| | Alpharetta| 2016-09-19 00:58:23.803| SUCCESS| 1| 0| 0| 0| ... I actually already wrote a short Perl script to do this, but I was hoping I could use Text::Table as a more general solution. From what I've read in the Text::Table doc page, I have no idea how to do this. I can see how to "load" the data, but I don't understand the rendering options. ----------------- David M. Karr | AT&T | Digital Experience Technology Services (206) 909-0664 cell (425) 892-5432 cell (206) 393-9042 skype
Subject: Re: [rt.cpan.org #117987]
Date: Sun, 20 Nov 2016 20:10:59 +0200
To: bug-Text-Table [...] rt.cpan.org
From: Rihards <richlv [...] nakts.net>
i was trying to do the same, and couldn't figure out a built-in way to format it all automatically. the best i came up with follows - maybe that helps somebody else. if there is a better way, i'd love to find out about it :) instead of just printing out your final table, i manually printed out rule-title-rule-body-rule. oh, and i also manually specified all separators. $outputtable = Text::Table->new( \'| ', "Host", \' | ', "interfaceid", \' | ', "DNS", \' |' ); ... populate your table $rule = $outputtable->rule( '-', '+'); print $rule; print $outputtable->title(); print $rule; print $outputtable->body(); print $rule; -- Rihards
On Tue Sep 20 11:30:25 2016, dk068x@att.com wrote: Show quoted text
> I was looking at Text::Table for the ability to print out a CSV in > ascii text, using the "line-crossings" convention, as is mentioned in > the Text::Table doc. > > Functionally, this looks like what I need, but frankly, I find this > doc page to be incomprehensible. You need to add many examples to > show how to use these features. You really only have a single > complete example at the top of the page. > > I'm trying to print out text from a CSV like the following: > > +-----------+------------------------+-----------+----------+---+--- > +----+ > | DC| TIMESTAMP| EVENT_CODE| SUBMITTED| OT| BE| > OCE| > +-----------+------------------------+-----------+----------+---+--- > +----+ > | Alpharetta| 2016-09-19 00:07:44.172| SUCCESS| 1| 0| 0| > 0| > | Alpharetta| 2016-09-19 00:10:26.938| SUCCESS| 1| 0| 0| > 0| > | Alpharetta| 2016-09-19 00:19:42.851| SUCCESS| 1| 0| 0| > 0| > | Alpharetta| 2016-09-19 00:38:51.395| SUCCESS| 1| 0| 0| > 0| > | Alpharetta| 2016-09-19 00:58:23.803| SUCCESS| 1| 0| 0| > 0| > > ... > > I actually already wrote a short Perl script to do this, but I was > hoping I could use Text::Table as a more general solution. From what > I've read in the Text::Table doc page, I have no idea how to do this. > I can see how to "load" the data, but I don't understand the rendering > options. > > ----------------- > David M. Karr | AT&T | Digital Experience Technology Services > (206) 909-0664 cell > (425) 892-5432 cell > (206) 393-9042 skype
Hi David! There are also some examples in the test files and in the examples subdir - see https://metacpan.org/source/SHLOMIF/Text-Table-1.131/examples . Do they help?
On Mon Nov 28 14:00:03 2016, SHLOMIF wrote: Show quoted text
> On Tue Sep 20 11:30:25 2016, dk068x@att.com wrote:
> > I was looking at Text::Table for the ability to print out a CSV in > > ascii text, using the "line-crossings" convention, as is mentioned in > > the Text::Table doc. > > > > Functionally, this looks like what I need, but frankly, I find this > > doc page to be incomprehensible. You need to add many examples to > > show how to use these features. You really only have a single > > complete example at the top of the page. > > > > I'm trying to print out text from a CSV like the following: > > > > +-----------+------------------------+-----------+----------+---+--- > > +----+ > > | DC| TIMESTAMP| EVENT_CODE| SUBMITTED| OT| BE| > > OCE| > > +-----------+------------------------+-----------+----------+---+--- > > +----+ > > | Alpharetta| 2016-09-19 00:07:44.172| SUCCESS| 1| 0| 0| > > 0| > > | Alpharetta| 2016-09-19 00:10:26.938| SUCCESS| 1| 0| 0| > > 0| > > | Alpharetta| 2016-09-19 00:19:42.851| SUCCESS| 1| 0| 0| > > 0| > > | Alpharetta| 2016-09-19 00:38:51.395| SUCCESS| 1| 0| 0| > > 0| > > | Alpharetta| 2016-09-19 00:58:23.803| SUCCESS| 1| 0| 0| > > 0| > > > > ... > > > > I actually already wrote a short Perl script to do this, but I was > > hoping I could use Text::Table as a more general solution. From what > > I've read in the Text::Table doc page, I have no idea how to do this. > > I can see how to "load" the data, but I don't understand the > > rendering > > options. > > > > ----------------- > > David M. Karr | AT&T | Digital Experience Technology Services > > (206) 909-0664 cell > > (425) 892-5432 cell > > (206) 393-9042 skype
> > Hi David! > > There are also some examples in the test files and in the examples > subdir - see https://metacpan.org/source/SHLOMIF/Text-Table- > 1.131/examples . Do they help?
Closing as rejected due to lack of responsiveness. If anyone shouts, I can reopen it.