Changes

Jump to navigation Jump to search
331 bytes added ,  04:03, 1 June 2016
new example
< [[source:m-database.tex|m-databasesource]] | [[Tables Overview]] >
{{todo|more examples and explanation}}
<texcode>\defineseparatedlist [MyTable] [separator={^^I}, % should be 'separator=tab[ulator]' leftInline =\bTD,right=\eTD, first=\bTR,last=\eTR, before=\bTABLE,after=\eTABLE]
\startMyTable % columns are separated with a tab (not with a spaceThis might be outdated)Cows Total Milking Pregnant01/1995 1709 1449 26001/1996 1713 1444 269... ... ... ...11/2004 1457 1295 16111/2005 1421 1263 158\stopMyTable</texcode>
<contextsource=yes mode=mkiv>
\setuplayout[scale=0.8]
\setupcolors[state=start]
\usemodule[database]
 
\catcode`\^^I=12
\defineseparatedlist
[MyTable]
[separator={^^I}tab,
left=\bTD,right=\eTD,
first=\bTR,last=\eTR,
11/2005 1421 1263 158
\stopMyTable
 
%load from a file
%\processseparatedfile[TSV][cows.tsv]
 
</context>
 
==Data from File==
 
(This is current as of 2016-05-31)
 
<context source=yes mode=mkiv>
\usemodule[database]
 
\starttext
 
\defineseparatedlist
[test]
[separator=space, % tab
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]
 
\processdatabasefile[test][csv.csv]
 
\stoptext
</context>
==Links==
* [http://www.physik.uni-freiburg.de/~doerr/exceltex/index.en.html exceltex] - LaTeX package to fetch data from Excel documents ([http://www.rubygarden.org/ruby?ScriptingExcelScripting Excel article])* [http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=tab4tex tab4tex] - Preprocessor for LaTeX tabular environments* [http://dl.contextgarden.net/myway/csv.pdf MyWay] about CSV* [http://www.ntg.nl/maps/42/12.pdf Using ConTeXt with databases] (article in NTG-MAPS) [[Category:Tables]]

Navigation menu