* [NTG-context] separatedlist with header repeating processing csv to table
@ 2024-10-02 7:48 juh+ntg-context--- via ntg-context
2024-10-02 11:49 ` [NTG-context] " Henning Hraban Ramm
0 siblings, 1 reply; 14+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-02 7:48 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: juh+ntg-context
Dear all,
some years ago I asked about how to process a csv file in a table with
repeating headers on following pages, but got no answer.
https://www.mail-archive.com/ntg-context@ntg.nl/msg98903.html
Now I am again working on this problem.
I wonder if there is a better way to process csv files to a table with
more flexibility?
Or do I simply miss the switch to mark the first row in the csv file as
the header that has to repeat?
TIA
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-02 7:48 [NTG-context] separatedlist with header repeating processing csv to table juh+ntg-context--- via ntg-context
@ 2024-10-02 11:49 ` Henning Hraban Ramm
2024-10-02 12:29 ` Henning Hraban Ramm
2024-10-03 8:47 ` [NTG-context] Re: separatedlist with header repeating processing csv to table juh+ntg-context--- via ntg-context
0 siblings, 2 replies; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-10-02 11:49 UTC (permalink / raw)
To: ntg-context
Am 02.10.24 um 09:48 schrieb juh+ntg-context--- via ntg-context:
> Dear all,
>
> some years ago I asked about how to process a csv file in a table with
> repeating headers on following pages, but got no answer.
>
> https://www.mail-archive.com/ntg-context@ntg.nl/msg98903.html
>
> Now I am again working on this problem.
>
> I wonder if there is a better way to process csv files to a table with
> more flexibility?
>
> Or do I simply miss the switch to mark the first row in the csv file as
> the header that has to repeat?
Did you try split=repeat instead of split=yes?
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-02 11:49 ` [NTG-context] " Henning Hraban Ramm
@ 2024-10-02 12:29 ` Henning Hraban Ramm
2024-10-03 8:49 ` juh+ntg-context--- via ntg-context
2024-10-03 8:47 ` [NTG-context] Re: separatedlist with header repeating processing csv to table juh+ntg-context--- via ntg-context
1 sibling, 1 reply; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-10-02 12:29 UTC (permalink / raw)
To: ntg-context
Am 02.10.24 um 13:49 schrieb Henning Hraban Ramm:
> Am 02.10.24 um 09:48 schrieb juh+ntg-context--- via ntg-context:
>> Dear all,
>>
>> some years ago I asked about how to process a csv file in a table with
>> repeating headers on following pages, but got no answer.
>>
>> https://www.mail-archive.com/ntg-context@ntg.nl/msg98903.html
>>
>> Now I am again working on this problem.
>>
>> I wonder if there is a better way to process csv files to a table with
>> more flexibility?
>>
>> Or do I simply miss the switch to mark the first row in the csv file
>> as the header that has to repeat?
>
> Did you try split=repeat instead of split=yes?
Oh, and of course you need a \bTABLEhead, otherwise there’s nothing to
repeat.
That means AFAIK, the header can’t be part of the CSV, using this simple
module.
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-02 11:49 ` [NTG-context] " Henning Hraban Ramm
2024-10-02 12:29 ` Henning Hraban Ramm
@ 2024-10-03 8:47 ` juh+ntg-context--- via ntg-context
1 sibling, 0 replies; 14+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-03 8:47 UTC (permalink / raw)
To: ntg-context; +Cc: juh+ntg-context
Am 02.10.24 um 13:49 schrieb Henning Hraban Ramm:
>
> Did you try split=repeat instead of split=yes?
Yes. No change.
I guess that the first line in csv is not marked as a table header, so
that ConTeXt does not know what to repeat.
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-02 12:29 ` Henning Hraban Ramm
@ 2024-10-03 8:49 ` juh+ntg-context--- via ntg-context
2024-10-03 10:06 ` vm via ntg-context
2024-10-03 12:15 ` Wolfgang Schuster
0 siblings, 2 replies; 14+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-03 8:49 UTC (permalink / raw)
To: ntg-context; +Cc: juh+ntg-context
Am 02.10.24 um 14:29 schrieb Henning Hraban Ramm:
> Oh, and of course you need a \bTABLEhead, otherwise there’s nothing to
> repeat.
> That means AFAIK, the header can’t be part of the CSV, using this simple
> module.
I tried to put the header into the before part of setupseparatedlist,
but this does not work. I also fear that I cannot do it with this
module. Are there other means to build a table from csv?
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-03 8:49 ` juh+ntg-context--- via ntg-context
@ 2024-10-03 10:06 ` vm via ntg-context
2024-10-03 12:15 ` Wolfgang Schuster
1 sibling, 0 replies; 14+ messages in thread
From: vm via ntg-context @ 2024-10-03 10:06 UTC (permalink / raw)
To: ntg-context; +Cc: vm
On 03/10/2024 10:49, juh+ntg-context--- via ntg-context wrote:
>
> I tried to put the header into the before part of setupseparatedlist,
> but this does not work. I also fear that I cannot do it with this
> module. Are there other means to build a table from csv?
have you checked the handlecsv module?
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-03 8:49 ` juh+ntg-context--- via ntg-context
2024-10-03 10:06 ` vm via ntg-context
@ 2024-10-03 12:15 ` Wolfgang Schuster
2024-10-03 14:33 ` vm via ntg-context
2024-10-08 16:13 ` [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table) juh+ntg-context--- via ntg-context
1 sibling, 2 replies; 14+ messages in thread
From: Wolfgang Schuster @ 2024-10-03 12:15 UTC (permalink / raw)
To: mailing list for ConTeXt users, juh+ntg-context--- via ntg-context
juh+ntg-context--- via ntg-context schrieb am 03.10.2024 um 10:49:
> Am 02.10.24 um 14:29 schrieb Henning Hraban Ramm:
>> Oh, and of course you need a \bTABLEhead, otherwise there’s nothing to
>> repeat.
>> That means AFAIK, the header can’t be part of the CSV, using this
>> simple module.
>
> I tried to put the header into the before part of setupseparatedlist,
> but this does not work. I also fear that I cannot do it with this
> module. Are there other means to build a table from csv?
ConTeXt has a better parser for csv files since many years (which is
used by the already mentioned handlecsv module) but there is no TeX
interface for it.
The example below shows how the parser can be used to store csv data in
a Lua table, you can even split of the first line of data to use it as
header etc.
Afterwards you can use a loop to create a TeX table out of the stored
Lua table.
%%%% begin example
\setuplayout[tight]
\setuppapersize[A8,landscape]
\starttext
\startbuffer[cattle]
"Year","Cattle, total","Dairy cows"
"2009","3968","1489"
"2010","3975","1479"
"2011","3885","1470"
"2012","3879","1484"
"2013","4000","1553"
"2014","4068","1572"
"2015","4134","1622"
"2016","4251","1745"
"2017","4096","1694"
\stopbuffer
% \savebuffer [list=cattle,prefix=no,file=cattle.csv]
\startluacode
local csvsplitter = utilities.parsers.rfc4180splitter()
local tablecontent, tableheader =
csvsplitter(buffers.getcontent("cattle"),true)
-- local tablecontent, tableheader =
csvsplitter(io.loaddata("cattle.csv"),true)
context.bTABLE{ split = "repeat" }
context.bTABLEhead()
context.bTR()
for _, tablecell in next, tableheader do
context.bTH()
context(tablecell)
context.eTH()
end
context.eTR()
context.eTABLEhead()
context.bTABLEbody()
for _, tablerow in next, tablecontent do
context.bTR()
for _, tablecell in next, tablerow do
context.bTD()
context(tablecell)
context.eTD()
end
context.eTR()
end
context.eTABLEbody()
context.eTABLE()
\stopluacode
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-03 12:15 ` Wolfgang Schuster
@ 2024-10-03 14:33 ` vm via ntg-context
2024-10-03 16:18 ` Wolfgang Schuster
2024-10-08 16:13 ` [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table) juh+ntg-context--- via ntg-context
1 sibling, 1 reply; 14+ messages in thread
From: vm via ntg-context @ 2024-10-03 14:33 UTC (permalink / raw)
To: ntg-context; +Cc: vm
On 03/10/2024 14:15, Wolfgang Schuster wrote:
> Afterwards you can use a loop to create a TeX table out of the stored
> Lua table.
just the freshup the mind,
how do you include a \setupTABLE in the lua section?
like
\setupTABLE[r][first][background=color, backgroundcolor=yellow]
.F
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: separatedlist with header repeating processing csv to table
2024-10-03 14:33 ` vm via ntg-context
@ 2024-10-03 16:18 ` Wolfgang Schuster
0 siblings, 0 replies; 14+ messages in thread
From: Wolfgang Schuster @ 2024-10-03 16:18 UTC (permalink / raw)
To: mailing list for ConTeXt users, vm via ntg-context
vm via ntg-context schrieb am 03.10.2024 um 16:33:
>
>
> On 03/10/2024 14:15, Wolfgang Schuster wrote:
>> Afterwards you can use a loop to create a TeX table out of the stored
>> Lua table.
>
> just the freshup the mind,
> how do you include a \setupTABLE in the lua section?
> like
> \setupTABLE[r][first][background=color, backgroundcolor=yellow]
You write it as
context.setupTABLE({"r"}, {"first"}, {background="color",
backgroundcolor="yellow"})
When there is only a single argument with brackets you can omit () but
not in this case where the command takes multiple argument.
For more information about TeX commands in Lua take a look at the
"ConTeXt Lua document" (cld-mkiv.pdf) manual.
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table)
2024-10-03 12:15 ` Wolfgang Schuster
2024-10-03 14:33 ` vm via ntg-context
@ 2024-10-08 16:13 ` juh+ntg-context--- via ntg-context
2024-10-08 17:10 ` [NTG-context] Re: configuring spitter Henning Hraban Ramm
2024-10-08 17:16 ` Wolfgang Schuster
1 sibling, 2 replies; 14+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-08 16:13 UTC (permalink / raw)
To: Wolfgang Schuster, mailing list for ConTeXt users; +Cc: juh+ntg-context
Am 03.10.24 um 14:15 schrieb Wolfgang Schuster:
> %%%% begin example
> \setuplayout[tight]
>
> \setuppapersize[A8,landscape]
>
> \starttext
>
> \startbuffer[cattle]
> "Year","Cattle, total","Dairy cows"
> "2009","3968","1489"
> "2010","3975","1479"
> "2011","3885","1470"
> "2012","3879","1484"
> "2013","4000","1553"
> "2014","4068","1572"
> "2015","4134","1622"
> "2016","4251","1745"
> "2017","4096","1694"
> \stopbuffer
>
> % \savebuffer [list=cattle,prefix=no,file=cattle.csv]
>
> \startluacode
>
> local csvsplitter = utilities.parsers.rfc4180splitter()
>
> local tablecontent, tableheader =
> csvsplitter(buffers.getcontent("cattle"),true)
> -- local tablecontent, tableheader =
> csvsplitter(io.loaddata("cattle.csv"),true)
>
> context.bTABLE{ split = "repeat" }
> context.bTABLEhead()
> context.bTR()
> for _, tablecell in next, tableheader do
> context.bTH()
> context(tablecell)
> context.eTH()
> end
> context.eTR()
> context.eTABLEhead()
> context.bTABLEbody()
> for _, tablerow in next, tablecontent do
> context.bTR()
> for _, tablecell in next, tablerow do
> context.bTD()
> context(tablecell)
> context.eTD()
> end
> context.eTR()
> end
> context.eTABLEbody()
> context.eTABLE()
>
> \stopluacode
>
> \stoptext
> %%%% end example
This works perfectly with commas and doublequotes. Is it possible to
configure the splitter so that it works with semicolons as column
separator and no char as data separator?
Something like:
foo;bar;baz
second foo; second bar; second baz
TIA
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: configuring spitter
2024-10-08 16:13 ` [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table) juh+ntg-context--- via ntg-context
@ 2024-10-08 17:10 ` Henning Hraban Ramm
2024-10-08 17:16 ` Wolfgang Schuster
1 sibling, 0 replies; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-10-08 17:10 UTC (permalink / raw)
To: ntg-context
Am 08.10.24 um 18:13 schrieb juh+ntg-context--- via ntg-context:
> This works perfectly with commas and doublequotes. Is it possible to
> configure the splitter so that it works with semicolons as column
> separator and no char as data separator?
>
> Something like:
>
> foo;bar;baz
> second foo; second bar; second baz
Use the source, juh!
In
https://source.contextgarden.net/tex/context/base/mkiv/util-prs.lua?search=rfc4180splitter#l580
you can find that rfc4180splitter takes a "specification" parameter that
looks like { separator = ",", quote = '"' }.
I didn’t check if it works without quote character.
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: configuring spitter
2024-10-08 16:13 ` [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table) juh+ntg-context--- via ntg-context
2024-10-08 17:10 ` [NTG-context] Re: configuring spitter Henning Hraban Ramm
@ 2024-10-08 17:16 ` Wolfgang Schuster
2024-10-08 18:10 ` juh+ntg-context--- via ntg-context
1 sibling, 1 reply; 14+ messages in thread
From: Wolfgang Schuster @ 2024-10-08 17:16 UTC (permalink / raw)
To: juh+ntg-context; +Cc: mailing list for ConTeXt users
juh+ntg-context@mailbox.org schrieb am 08.10.2024 um 18:13:
> Am 03.10.24 um 14:15 schrieb Wolfgang Schuster:
>
>> %%%% begin example
>> \setuplayout[tight]
>>
>> \setuppapersize[A8,landscape]
>>
>> \starttext
>>
>> \startbuffer[cattle]
>> "Year","Cattle, total","Dairy cows"
>> "2009","3968","1489"
>> "2010","3975","1479"
>> "2011","3885","1470"
>> "2012","3879","1484"
>> "2013","4000","1553"
>> "2014","4068","1572"
>> "2015","4134","1622"
>> "2016","4251","1745"
>> "2017","4096","1694"
>> \stopbuffer
>>
>> % \savebuffer [list=cattle,prefix=no,file=cattle.csv]
>>
>> \startluacode
>>
>> local csvsplitter = utilities.parsers.rfc4180splitter()
>>
>> local tablecontent, tableheader =
>> csvsplitter(buffers.getcontent("cattle"),true)
>> -- local tablecontent, tableheader =
>> csvsplitter(io.loaddata("cattle.csv"),true)
>>
>> context.bTABLE{ split = "repeat" }
>> context.bTABLEhead()
>> context.bTR()
>> for _, tablecell in next, tableheader do
>> context.bTH()
>> context(tablecell)
>> context.eTH()
>> end
>> context.eTR()
>> context.eTABLEhead()
>> context.bTABLEbody()
>> for _, tablerow in next, tablecontent do
>> context.bTR()
>> for _, tablecell in next, tablerow do
>> context.bTD()
>> context(tablecell)
>> context.eTD()
>> end
>> context.eTR()
>> end
>> context.eTABLEbody()
>> context.eTABLE()
>>
>> \stopluacode
>>
>> \stoptext
>> %%%% end example
>
> This works perfectly with commas and doublequotes. Is it possible to
> configure the splitter so that it works with semicolons as column
> separator and no char as data separator?
I don't know what you mean with data separator but the quote marks are
optional and only needed when the column entry contains the column
separator itself. In my example all double quotes except the one for
"Cattle, total" are redundant and can be removed.
> Something like:
>
> foo;bar;baz
> second foo; second bar; second baz
You can change the separator when you create a custom splitter.
local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: configuring spitter
2024-10-08 17:16 ` Wolfgang Schuster
@ 2024-10-08 18:10 ` juh+ntg-context--- via ntg-context
2024-10-08 18:29 ` Wolfgang Schuster
0 siblings, 1 reply; 14+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-08 18:10 UTC (permalink / raw)
To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users, juh+ntg-context
Am 08.10.24 um 19:16 schrieb Wolfgang Schuster:
> You can change the separator when you create a custom splitter.
>
> local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }
Thanks a lot.
Just curious. I often wonder in pure ConTeXt when to use curly bracets
and when square brackets
In this lua code I would think we would need simple rounded ones.
Like in your first example where you call the splitter without options:
local csvsplitter = utilities.parsers.rfc4180splitter()
I am sure that this is some lua convention, but, nevertheless, it
puzzles me.
Ciao!
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
* [NTG-context] Re: configuring spitter
2024-10-08 18:10 ` juh+ntg-context--- via ntg-context
@ 2024-10-08 18:29 ` Wolfgang Schuster
0 siblings, 0 replies; 14+ messages in thread
From: Wolfgang Schuster @ 2024-10-08 18:29 UTC (permalink / raw)
To: juh+ntg-context; +Cc: mailing list for ConTeXt users
juh+ntg-context@mailbox.org schrieb am 08.10.2024 um 20:10:
> Am 08.10.24 um 19:16 schrieb Wolfgang Schuster:
>> You can change the separator when you create a custom splitter.
>>
>> local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }
>
> Thanks a lot.
>
> Just curious. I often wonder in pure ConTeXt when to use curly bracets
> and when square brackets
>
> In this lua code I would think we would need simple rounded ones.
>
> Like in your first example where you call the splitter without options:
>
> local csvsplitter = utilities.parsers.rfc4180splitter()
>
> I am sure that this is some lua convention, but, nevertheless, it
> puzzles me.
It's explained in the Lua manual:
%%%% begin quotation
Lua 5.4 Reference manual
[...]
3.4.10 -- Function calls
[...]
A call of the form f{fields} is syntactic sugar for f({fields}); that
is, the argument list is a single new table.
[...]
%%%% end quotation
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-10-08 18:32 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-02 7:48 [NTG-context] separatedlist with header repeating processing csv to table juh+ntg-context--- via ntg-context
2024-10-02 11:49 ` [NTG-context] " Henning Hraban Ramm
2024-10-02 12:29 ` Henning Hraban Ramm
2024-10-03 8:49 ` juh+ntg-context--- via ntg-context
2024-10-03 10:06 ` vm via ntg-context
2024-10-03 12:15 ` Wolfgang Schuster
2024-10-03 14:33 ` vm via ntg-context
2024-10-03 16:18 ` Wolfgang Schuster
2024-10-08 16:13 ` [NTG-context] configuring spitter (was: separatedlist with header repeating processing csv to table) juh+ntg-context--- via ntg-context
2024-10-08 17:10 ` [NTG-context] Re: configuring spitter Henning Hraban Ramm
2024-10-08 17:16 ` Wolfgang Schuster
2024-10-08 18:10 ` juh+ntg-context--- via ntg-context
2024-10-08 18:29 ` Wolfgang Schuster
2024-10-03 8:47 ` [NTG-context] Re: separatedlist with header repeating processing csv to table juh+ntg-context--- via ntg-context
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).