With the latest version of the datatool package, if I compile this file
\begin{filecontents*}{\jobname.csv}
x,y
11,12
\end{filecontents*}
\documentclass{article}
\usepackage{datatool}
\DTLloaddb{table}{\jobname.csv}
\begin{document}
\end{document}
I get this error
./example.tex:9: LaTeX Error: Missing \begin{document}.
In the pdf file it appears
,12
If I substitute 11 for 22 or 33 or ... I get the same error, but if I use any other number it compiles fine.
The file list is this
*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
datatool.sty 2017/11/10 v2.28 (NLCT)
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
xfor.sty 2009/02/05 v1.05 (NLCT)
substr.sty 2009/10/20 v1.2 Handle substrings
etoolbox.sty 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
datatool-base.sty 2017/11/10 v2.28 (NLCT)
amsmath.sty 2017/09/02 v2.17a AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
datatool-fp.sty 2017/11/10 v2.28 (NLCT)
fp.sty 1995/04/02
defpattern.sty 1994/10/12
fp-basic.sty 1996/05/13
fp-addons.sty 1995/03/15
fp-snap.sty 1995/04/05
fp-exp.sty 1995/04/03
fp-trigo.sty 1995/04/14
fp-pas.sty 1994/08/29
fp-random.sty 1995/02/23
fp-eqn.sty 1995/04/03
fp-upn.sty 1996/10/21
fp-eval.sty 1995/04/03
\dtl@trim #1->\def \@dtl@trmstr {}\if #1\par \else \expandafter \@dtl@start@tri
probably shouldn't be using\if
\if
so it was just a matter of tracing to find which\if
was causing the problem.