I want to get \foo with the value of the first row outside the cycle.
Code: Select all
\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[italian]{babel}
\usepackage{datatool}
\begin{document}
\DTLloaddb{elenconote2}{note.txt}
\DTLforeach*[\value{DTLrowi}<1]{elenconote2}{\1=name}{%
\gdef\foo{\1}
this is the first row: \foo
\\
}
this should be the first row: \foo
\end{document}
Code: Select all
name
01
02
03
Code: Select all
this is the rst row: 01
this should be the rst row: 03
Someone please help me to find the error. Thank you.