My question is related but with some complication. How to replace last comma by dot after last encountered word?
% !TeX program = pdflatex
% !TeX encoding = utf8
\documentclass[]{book}
\usepackage{filecontents}
\begin{filecontents*}{data.dat}
Number|Entry
1|Alpha
2|Beta
2|Gamma
3|Delta
\end{filecontents*}
\usepackage{datatool}
\DTLsetseparator{|}
\DTLloaddb{letters}{data.dat}
\begin{document}
\DTLforeach*[\Number=2]{letters}% database label
{\Number=Number, \Entry=Entry}% assignment
{% Stuff to do at each iteration:
\DTLiflastrow{\Entry.}{\Entry,} % Here should be a right solution
}
\end{document}
\Entry
. I'm afraid you can have more complicated settings, so I'm waiting for you to be more specific. Or are all applications like this and the one in your previous question? – egreg Apr 26 '19 at 14:00