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 package on a LaTeX document. I use it to write labels. I have the addr on a CSV file. The problem is that I'm unable to write more that 25 labels. It seem like if datatool can't load more that 25 line from CSV.

Any idea?

this is the .cvs file:

nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov
nome,via,,cap,localita,prov

and this is the code:

\documentclass{letteracdp}
\usepackage[italian]{babel}
%\usepackage{envlab}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{datatool}
\usepackage[usenames]{color}
\usepackage [normalem]{ulem}
\usepackage[utf8x]{inputenc}
\usepackage{textcomp}
\usepackage{tabularx}
\DTLloaddb{indirizzi}{/home/kde/Dropbox/associazione/documenti/ind_sas.csv}
%
\pagestyle{fancy}
\makelabels
%
\begin{document}
\DTLforeach*{indirizzi}{%
\nome=nome,\cognome=cognome,\via=via,\civico=civico,\cap=cap,\localita=localita,\prov=prov,}{
%
\begin{letter}{\emph{\textbf{\nome \space }\\\via\space \\\textbf{\cap},\space \localita\space  \prov}}
%
\end{letter}
}
\end{document}
share|improve this question
1  
Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  N.N. Aug 25 '11 at 9:08
    
I'm certain that datatools can read more than 25 entries. Something else is wrong with your code. –  Ulrike Fischer Aug 25 '11 at 9:19
    
Could you post a minimal example document and the first 26 lines of your data file? –  Jake Aug 25 '11 at 11:04
    
yes I can. Can I upload file? Or do I have to make it via private messages? –  user7143 Aug 25 '11 at 21:55
    
@user7143: You should edit your question to include the code. –  Jake Aug 26 '11 at 3:29
show 6 more comments

1 Answer

The CSV file is wrong, as it misses the header; moreover you are declaring more fields than are contained in the records. Adding the line

nome,via,civico,cap,localita,prov

as the first in the CSV file and correcting the command into

\DTLforeach*{indirizzi}{%
\nome=nome,\via=via,\civico=civico,\cap=cap,\localita=localita,\prov=prov}{%
\begin{letter}{\emph{\textbf{\nome \space }}\\
  \via\space\civico \\
  \textbf{\cap},\space \localita\space  \prov}
\opening{Dear \nome}
Some text
\closing{Best regards}
\end{letter}
}

the file can be processed regularly. I tried with 49 lines, surely more can be managed.

share|improve this answer
add comment

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.