# datatool: get rid of a specific character

How can I get rid of a character while loading a table from a file with datatool? In my case, I like to get rid of every double quote that appears within the data.

\documentclass{minimal}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{datatool}
\usepackage{multido}
\usepackage{filecontents}

\begin{filecontents*}{members.csv}
"Rolle/Status","Vorname","Nachname"
"Mitglied","FirstName1","LastName1"
"Mitglied","FirstName2","LastName2"
"Mitglied","FirstName3","LastName3"
\end{filecontents*}

\DTLsetdelimiter{,}

\begin{document}

\multido{\nx = 1+1}{\DTLrowcount{members}}{
\DTLgetvalue{\studentlastname}{members}{\nx}{3}
\DTLgetvalue{\studentfirstname}{members}{\nx}{2}
\studentlastname
\studentfirstname
}

\end{document}


By the way, when I add an extra line between \DTLgetvalue and \studentlastname, I'll get multiple errors. What is the reason?

-
Could you please add a minimal working example (MWE)? –  egreg Feb 14 '13 at 10:35
I just added a MWE. I'll like to get rid of the ". –  DaPhil Feb 14 '13 at 11:46

There's no need to use \multido for cycling through the rows of a database, since datatool provides \DTLforeach; see section 5.4 in the manual of datatool.

If you're sure that all entries are between quotes, this should work:

\documentclass{article}
\usepackage{datatool}
\usepackage{filecontents}

\begin{filecontents*}{members.csv}
"Rolle/Status","Vorname","Nachname"
"Mitglied","FirstName1","LastName1"
"Mitglied","FirstName2","LastName2"
"Mitglied","FirstName3","LastName3"
\end{filecontents*}

\newcommand\stripquotes[1]{\expandafter\dostripquotes#1}
\def\dostripquotes"#1"{#1} % \def is necessary here

\DTLsetdelimiter{,}

@DaPhil There's no need of \multido. –  egreg Feb 14 '13 at 12:20