ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Converting a CSV file to a Lua table and Lua file
@ 2020-07-04 12:02 Otared Kavian
  0 siblings, 0 replies; only message in thread
From: Otared Kavian @ 2020-07-04 12:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I have a bash script which converts a CSV file into a Lua table, which is then used in ConTeXt.
It works fine, but I wonder whether there is a code within LuaMetaTeX for doing this directly there (writing a new file which contains the Lua table). This would be more efficient and neater.

Thus a CSV file « example.csv » containing the lines:

X,Y,Z
0.05597,0.6612,0.8618
0.156804,0.8784,0.961
0.496804,0.8784,0.9324
0.176804,0.648,0.9643

would be converted and wriiten into a lua file « example.lua » containing the lines:

return{
--	{X,Y,Z},
	{0.05597,0.6612,0.8618}
	{0.156804,0.8784,0.961}
	{0.496804,0.8784,0.9324}
	{0.176804,0.648,0.9643}
	}


Thanks in advance for any help: Otared K.
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-04 12:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04 12:02 Converting a CSV file to a Lua table and Lua file Otared Kavian

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).