I have a csv file containing a list of names with addresses. I'm using the datatool package to load these and output stickers (using the labels package) for envelopes. This is done using \DTLforeach. Sometimes a name is too long for one line so I manually include a \\ in the csv as to not hyphenate a name.
I also want to print a complete list of all recipients using \DTLdisplaydb.
For my stickers this works very well, but of course this breaks my table listing all recipients.
As an MWE, save this as data.csv:
Name,Street,City
John Doe,Street 1,A City
Osop Eskobmr Sempeg Cotbadt\\Demnoskoywar,Street 9,B City
Jeeta Ex,Street 2,A City
and use
\documentclass{article}
\usepackage{labels}
\usepackage{datatool}
\begin{document}
\DTLloaddb{address}{data.csv}
\DTLforeach{address}{\name=Name,\street=Street,\city=City}%
{\addresslabel{\name\\ \street\\ \city}}
\DTLdisplaydb{address}
\end{document}
I guess I could insert a special command like \mybreak and define it as empty or as \newline depending on the situation. But I would prefer to keep the data as is.