Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using datatool to make a mail merge.

I have my .csv file. I've defined my \DTLloaddb{indirizzi}{/home/kde/Dropbox/edile_150/consulenti_arezzo.csv} and if I use \DTLdisplaydb{indirizzi} I have my table printed on the doc.

But if I try to make that:

\begin{document}

\DTLforeach*{indirizzi}{%
\nome=nome, \cognome=cognome,%
\num=num, \via=VIA, \civico=civico, \localita=localita \cap=cap,%
\provincia=provincia, \tel=tel
}
\begin{letter}

%\DTLdisplaydb{indirizzi}

{\nome\ \cognome\\
\via, \civico\ \num\\
\via \civico \localita \\
\cap \provincia \tel}

when I make a PDF, I receive this error:

undefined control sequence \begin

The line number is the same of \begin{letter} and then other errors

(Missing control sequence \begin)

I can't understand why I receive this error.

share|improve this question

1 Answer 1

There are some errors in your input.

\begin{document}

\DTLforeach*{indirizzi}{%
\nome=nome, \cognome=cognome,%
\num=num, \via=VIA, \civico=civico, \localita=localita, \cap=cap,%
\provincia=provincia, \tel=tel}
{\begin{letter}
  {\nome\ \cognome\\
  \via, \civico\ \num\\
  \via \civico \localita \\
  \cap \provincia \tel}}

A comma was missing after localita; more important, \DTLforeach* requires three arguments: the symbolic name of the database, the assignments and the text that must be acted on. With braces around \begin{letter}{...} the document should be processed correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.