# Skipping blank fields for address labels using datatool and envlab [closed]

I am trying to process the following into Avery 5160 mailing labels, using the \skipblank code that someone else posted on this site to suppress blank lines:

\documentclass[10pt]{letter}
\usepackage[avery5160label,noprintbarcodes]{envlab}
\usepackage{datatool}
\usepackage{makerobust}
\makeatletter
%commands to skip blank or missing fields
%* version replaces with space only
\newcommand\skipblank{\@ifstar\@spskip\@nlskip}
\newcommand\@nlskip[1]{\ifthenelse{\DTLiseq{#1}{}}{\relax}{#1\\}}
\newcommand\@spskip[1]{\ifthenelse{\DTLiseq{#1}{}}{\relax}{#1\space}}
\MakeRobustCommand{\@nlskip}
\MakeRobustCommand{\@spskip}
\makeatother

\makelabels
\begin{document}
\startlabels

\DTLsetseparator{|}

\mlabel{
\skipblank*{\name},\ \skipblank*{\role}\\
\skipblank{\site}
\city\ \st\ \zip\ \ \country

}
}

\end{document}


But I keep getting the following LaTeX error:

"
! Missing control sequence inserted.
<inserted text>
\inaccessible
l.43 }

?
! Missing { inserted.

l.43 }

?
! Missing } inserted.
"


It was my understanding that unmatched } errors were related to fragile commands, hence the use of \MakeRobustCommand{}, but this doesn't seem to help. It is extremely frustrating. Would appreciate any suggestions.

-
Can you provide some entries of you csv file. Up to now we can't test your example. –  Marco Daniel Apr 14 '12 at 22:14
Without a complete demo, we can't hope to answer this. –  Joseph Wright May 6 '12 at 8:22