Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
My understanding is that one cannot include a tab-delimited file as table data.
I've tried changing separator - and tried an include1 macro as well since include converts tabs to spaces. Am I missing something? Tables cannot use tabs as a delimiter? -brian |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Tables can, in fact, use tabs as a delimiter. (The name of the attribute is separator). The only caveat is that you must specify the value using a literal tab character, not an escape code. I put the example in a gist so as not to lose the formatting (and to demonstrate it in action) I'll add an enhancement to Asciidoctor to allow the separator to be specified using the escape code, \t. [separator=\t] Cheers, -Dan On Mon, Mar 13, 2017 at 3:44 PM, brianrepko [via Asciidoctor :: Discussion] <[hidden email]> wrote: My understanding is that one cannot include a tab-delimited file as table data. Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
Hi Dan,
Thanks for the quick reply. A ticket for allowing `\t` as separator would be great.
In addition, I think a ticket for an include macro option to preserve tabs is also
needed. Tabs are troublesome in regular editors - in order to do what you have
in the gist. However, they are quite common for external example data files
(particularly in bioinformatics). So the combination of separator and include is
what is needed, I feel. You could even bundle that all up in a format="tsv" if it
was common enough.
Thanks again!!
-brian
----- Original message -----
From: "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]>
To: brianrepko <[hidden email]>
Subject: Re: Table include macro - tab-delimited files
Date: Mon, 13 Mar 2017 21:20:36 -0700 (MST)
Tables can, in fact, use tabs as a delimiter. (The name of the attribute is separator). The only caveat is that you must specify the value using a literal tab character, not an escape code.
I put the example in a gist so as not to lose the formatting (and to demonstrate it in action)
I'll add an enhancement to Asciidoctor to allow the separator to be specified using the escape code, \t.
[separator=\t]
Cheers,
-Dan
On Mon, Mar 13, 2017 at 3:44 PM, brianrepko [via Asciidoctor :: Discussion] <[hidden email]> wrote:
--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
If you reply to this email, your message will be added to the discussion below:
To unsubscribe from Table include macro - tab-delimited files, click here.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
A ticket for allowing `\t` as separator would be great. See https://github.com/asciidoctor/asciidoctor/issues/2073 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In reply to this post by brianrepko
The include directive does not remove tabs by default. Only if you set the indent attribute on the include directive and set the tabsize document attribute will tabs be expanded, but that's intended for use with source code, not tsv. Cheers, |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In reply to this post by brianrepko
Adding the tsv attribute does seem intriguing. I'll add a note to the open issue about it. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
In reply to this post by mojavelinux
Thanks Dan - I was clearly reading old asciidoc doc (thus my mention of the `include1` macro above).
All great to know, I'll embedding the tab character in the document as separator for now and will watch the issue above (thanks for creating that). |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
On Tue, Mar 14, 2017 at 6:40 PM, brianrepko [via Asciidoctor :: Discussion] <[hidden email]> wrote: Thanks Dan - I was clearly reading old asciidoc doc (thus my mention of the `include1` macro above). Ah. Yeah, you want to be here: http://asciidoctor.org/docs/user-manual/ We probably need to call out how to do tab-separated data, though. That information is currently missing. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
+1.
Serendipity. I tried today including TSV output from MS Excel and found the same requirement. Best regards, Sturt |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Sturt, TSV data is now supported in Asciidoctor 1.5.6.1. Please see http://asciidoctor.org/docs/user-manual/#delimiter-separated-values for details. Did you have a specific question about this feature? -Dan On Mon, Aug 14, 2017 at 8:06 AM, sturt [via Asciidoctor :: Discussion] <[hidden email]> wrote: +1. Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Hi Dan,
Thank you for responding so quickly. When including a TSV file, how could we force a new row (not only a new cell) at the end of a data line? INTENT: My specific intent was to have the tsv included without modification, no wrap, in monospace, with the columns lining up, looking like a formatted datafile, not a gridded table . SOLUTION: My final literal include below gave: monospace formatting, not lined up, without modification, which was sufficient for this dataset. ---- include::{datadir}data-7-cols-last-col-empty.txt[] ---- WORKING AS DESIGNED: The cause of my original comment in this thread was my data. It had an empty ending column, which therefore ended in a tab, making a "ragged table". Therefore AsciiDoc is working as described in http://asciidoctor.org/docs/user-manual/#csv-and-tsv The tsv include below works if I have "" as the last cell value of the data line, which I'll use in other circumstances. [%header, format=tsv] |=== include::{datadir}data-7-cols-empty-cells-as-double-quotes.txt[] |=== Thanks again for your previous response and great work on AsciiDoc. Best regards, Sturt. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
To my knowledge, the only way to have a newline in a table cell sourced from TSV data is to enclose the value in quotes. Cheers, -Dan On Tue, Aug 15, 2017 at 7:44 AM sturt [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi Dan, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |