Hi,

the rfc4180splitter function from util-prs.lua returns a empty table
when the option to turn the first line into a header is disabled.


The following example from the source


%%%% begin example
\starttext

\startluacode

local mycsvsplitter = utilities.parsers.rfc4180splitter()

local crap = [[
"first","second","third","fourth"
"1","2","3","4"
"a","b","c","d"
"foo","bar""baz","boogie","xyzzy"
]]

local list, names = mycsvsplitter(crap,true)   inspect(list) inspect(names)
local list, names = mycsvsplitter(crap)        inspect(list) inspect(names)

\stopluacode

\stoptext
%%%% end example


returns these tables:


%%%% begin result
table={
 { "1", "2", "3", "4" },
 { "a", "b", "c", "d" },
 { "foo", "bar\"baz", "boogie", "xyzzy" },
}
table={
 "first",
 "second",
 "third",
 "fourth",
}
table={
}
nil
%%%% end result


Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to