I'm using datatool to load a csv table. Students names are in that table (first column first name, second column last name) and I like to print them on the exam. In a related question, I asked how to print a student id number on each exam. In a similar way I like to print the names taken from the table on each exam. My first approach (I just like to print an arbitrary value) looks like this and unfortunately doesn't work:
\documentclass[
paper=A4,
fontsize=10pt
]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{multido}
\usepackage{datatool}
\pagestyle{empty}
\newcounter{studentidcounter}
\setcounter{studentidcounter}{1}
\newcommand{\studentid}{%
\ifnum\thestudentidcounter<10\relax%
0\thestudentidcounter\else%
\thestudentidcounter\fi%
}
\DTLsetdelimiter{,}
\DTLloaddb[noheader=true]{members}{members.csv}
\DTLgetvalue{\studentsurname}{members}{1}{2}
\DTLgetvalue{\studentlastname}{members}{1}{1}
\newcommand{\studentname}[2]{#1 #2}
\begin{document}
\show\studentsurname
\multido{\nx = 1+1}{3}{
\input{examMain.tex}
\clearpage
%----------------------------------------------------------------------
% Uncomment next lines if exam has an odd number of pages.
% \newpage
% \mbox{}
% \newpage
%----------------------------------------------------------------------
\stepcounter{studentidcounter}%
\setcounter{equation}{0}
}
\end{document}
So how can I achieve that the table is iterated within multido? And I need some kind of macro that I can use in examMain.tex to access the students full name?
A possible example of members.cvs could look like this
Name1, FirstName1
Name2, FirstName2
Name3, FirstName3
members.csv
file is organized?