From 10521e719d9d01eb2dfcd64efd2fd2ab1b3530ab Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 May 2018 17:56:53 +0000 Subject: datatool (16apr18) git-svn-id: svn://tug.org/texlive/trunk@47543 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/datatool/datatool-user.tex | 45 +++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/doc/latex/datatool/datatool-user.tex') diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex index 15581834dc6..aeefbfea21a 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex +++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex @@ -103,11 +103,11 @@ \MakeShortVerb{"} - \title{User Manual for datatool bundle version~2.29} + \title{User Manual for datatool bundle version~2.30} \author{Nicola L.C. Talbot\\ \url{http://www.dickimaw-books.com/}} - \date{2017-11-12} + \date{2018-04-16} \maketitle \pagenumbering{roman} @@ -122,7 +122,7 @@ The \styfmt{datatool} bundle comes with the following documentation: \item[\url{datatool-code.pdf}] Advanced users wishing to know more about the inner workings of all the packages provided in the \styfmt{datatool} bundle should - read \qt{Documented Code for datatool v2.29} + read \qt{Documented Code for datatool v2.30} \item[INSTALL] Installation instructions. @@ -4102,21 +4102,36 @@ The result is shown in \autoref{tab:dyn}. \end{example} \section{Null Values} +\begin{important} +Note that a null value is not the same as an empty value. Empty +values can be tested using \sty{etoolbox}'s \ics{ifdefempty} or +similar. +\end{important} + If a database is created using \cs{DTLnewdb}, \cs{DTLnewrow} and \cs{DTLnewdbentry} (rather than loading it from an ASCII file), it is possible for some of the entries to have null values when a value is not assigned to a given key for a given row. It's also possible for data fetched from a~SQL database using -\app{datatooltk} to contain null values\footnote{You can also use -the \app{datatooltk} GUI to assign null values.}, but data loaded using +\app{datatooltk} to contain null values, and you can use +the \app{datatooltk} GUI to assign null values, but data loaded using \cs{DTLloaddb} (or \cs{DTLloadrawdb}) will have empty not null -values for any blank cells. - -\begin{important} -Note that a null value is not the same as an empty value. Empty -values can be tested using \sty{etoolbox}'s \ics{ifdefempty} or -similar. -\end{important} +values for any \emph{blank} cells. However, you will get null values when +loading a CSV file if cells are missing (rather than empty). For +example: +\begin{verbatim} +Column 1,Column 2,Column 3 +Foo,Bar +Foo,,Baz +Foo,Bar,Baz +\end{verbatim} +This has an empty cell (the second column in \texttt{Foo,,Baz}) and +a null cell (the third column in \texttt{Foo,Bar}). If the first +row of data was instead +\begin{verbatim} +Foo,Bar, +\end{verbatim} +then the third column is now empty, not null. When you iterate through the database using \cs{DTLforeach} (described in \autoref{sec:dbforeach}), @@ -5449,12 +5464,6 @@ you can just use \cs{input} or you can use: This checks for the file's existence and assigns the database name to the control sequence \meta{cs}. -\begin{important} -If you find a~problem caused by \TeX's automatic insertion of a line -break every 80 characters when writing to a file, try loading the -\sty{morewrites} package before \sty{datatool}. -\end{important} - Databases saved using \cs{DTLsavetexdb}, \cs{DTLsaverawdb} and \cs{DTLprotectedsaverawdb} can be loaded using \LaTeX's standard \ics{input} command. As from version 2.15, the last line of the -- cgit v1.2.3