2

I try to load a .csv into my .tex using datatool, but it uses only the first given key and I just don't get why.

first lines of my example foobar.csv:

1;a;ax
2;b;be
2;c;ck
3;d;do

(at the end the last column will be filled with picture.jpg, that will be loaded into a tkizpicture and it works fine if I take only the last column. The same applies for the other columns they will have a special action that works fine if I take only that one column.)

mwe:

\documentclass{standalone}
\usepackage{datatool}
\DTLloaddb[noheader,keys={1,2,3}]{foobar}{foobar.csv}
\begin{document}
\DTLdisplaydb{foobar}
\end{document}

it isn't giving an error, as I don't use the key in this example, but it isn't printing the keys 2 and 3, but only 1. It is printing the three columns perfectly, but not the keys. If I use the key in a more complex example I get the error:

foobar.tex:51: Package data tool Error: Can't assign \Title : there is no key '2' in data base 'foobar'.

thanks for your help!

0

1 Answer 1

3

the solution is quite easy, just had to add

\DTLsetseparator{;}

before

\DTLloaddb[noheader,keys={1,2,3}]{foobar}{foobar.csv}

as the separator seemed to be the problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .