GeneralLabels from CSV File

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
renareto
Posts: 7
Joined: Sat Mar 20, 2010 12:08 am

Labels from CSV File

Post by renareto »

Hi,
I need to print some labels. Is there some class (or package) that can do that well?

I'm using \makelabels command of the letteracdp class.
It produce just the first 25 labels, then stops. I've tried with 2 or 3 files, but always the same result.

TIA

Renato

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Labels from CSV File

Post by nlct »

Can you produce a minimal example? Do you get any error messages?

Regards
Nicola Talbot
renareto
Posts: 7
Joined: Sat Mar 20, 2010 12:08 am

Labels from CSV File

Post by renareto »

emh... :oops: could it be a 'minimal exampe'?

Code: Select all

\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/edil_150/associazione/documenti/ind_sas.csv}
%
\pagestyle{fancy}

%\fancypagestyle{firstpage}{    % note opening bracket
 % \fancyhf{}  %<<<<----- clear all fields
  %\fancyhead[L]{\includegraphics[width=.2\columnwidth]{edil150}\quad \hrulefill}


%\fancyfoot[c]{\tiny
%\begin{tabularx}{\textwidth}{|X|X|X|}
%\textbf{sede Legale}&\textbf{sede operativa}&\textbf {tel.} 0575 38 28 34 - \textbf{fax } 0575 98 38 78\\
%----------------fine prima riga--------------------- 
%Via Misericordia, 1/Q &Via Luigi Galvani, 25&www.edil150.it\\
%----------------fine seconda riga --------------------
%52042 C. Fiorentino (AR)&52100 Arezzo&presidente@edil150.it\\
%----------------fine terza riga----------------------
%\includegraphics[width=.1\columnwidth]{federterziario}&\includegraphics[width=.03\columnwidth]{cenai}&c.f. 92067640513\\
%---------------fine quarta riga----------------------
%\end{tabularx}}%

%}   % closing bracket

%\fancyhf{}

%\fancyhead[R]{ \includegraphics[width=.2\columnwidth]{edil150}\quad }


%\fancyfoot[C] {\hrulefill}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}
%\renewcommand{\familydefault}{\sfdefault}

%\address{Sign. Topolino,\\
%via Astuti, 34 \\
% Topolinia}non e’ altro che la sintesi delle tre certificazioni di regolarit\'a contributiva rilasciate dalle Casse Edili  e dagli Istituti previdenziali e assicuratori.

%\signature{\begin{tabular}[t]{r@{}r@{}} 
%  Renato Pontefice\\
% \includegraphics[width=.2\columnwidth]{firma} 
%  \end{tabular}}

\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}}

%linea per fare lettere senza intestazione. commentare la predente
%\begin{letter}{\emph{\textbf{\nome \space \cognome}\\ \via\space \civico\\ \cap\space \localita\space  \prov}}
 
%\DTLdisplaydb{indirizzi}
%\DTLdisplaydb{indirizzi}


\end{letter}
}
\end{document}

the .csv file

Code: Select all

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
the most important error, is that it doesn' produce more than 25 labels


TIA

Renato
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Labels from CSV File

Post by nlct »

You have errors in your assignment list:

Code: Select all

\DTLforeach*{indirizzi}{%
\nome=nome,\cognome=cognome,\via=via,\civico=civico,\cap=cap,\localita=localita,\prov=prov,}{
Don't have a trailing comma (after \prov=prov), and your CSV file doesn't contain the fields cognome and civio, but those don't cause the problem you describe.

The following works fine for me:

Code: Select all

\documentclass{letteracdp}
\usepackage{datatool}

\DTLloaddb{indirizzi}{test.csv}

\address{Sign. Topolino,\\
via Astuti, 34 \\
 Topolinia}

\makelabels

\begin{document}

\DTLforeach*{indirizzi}{%
\nome=nome,\via=via,\cap=cap,\localita=localita,\prov=prov}{

\begin{letter}{\emph{\textbf{\nome \space }\\\via\space
\\\textbf{\cap},\space \localita\space  \prov}}

\end{letter}
}
\end{document}
(where test.csv is the name I gave to your CSV file.)

Regards
Nicola Talbot
Post Reply