Login  Register

Re: +1 Re: Table include macro - tab-delimited files

Posted by sturt on Aug 15, 2017; 1:44pm
URL: https://discuss.asciidoctor.org/Table-include-macro-tab-delimited-files-tp5374p5848.html

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.