1

Hello friends I am not able to get or link the content of Core-1 to look up table content of Core-1 is ENGL when i used \coreOne i am getting output as ENGL, so what will happen if i use \coreOne (i.e \ENGL)? should i able to get as English because i have already define \newcommand{\ENGL}{English}. Kindly help me,, here is my MWE

\documentclass[a4paper]{article}

\usepackage{xstring,datatool}

\newcommand{\ENGL}{English}
\newcommand{\ALTE}{Alternative English}
\newcommand{\POSC}{Political Science}
\newcommand{\GEOG}{Geography}
\newcommand{\LOPH}{Logic \& Philosophy}
\newcommand{\ENVE}{Environmental Education}

\begin{filecontents*}{mark.csv}
Name,Core-1,Core-2,EL-1,EL-2,EL-3,Comp
Biki Teron,ENGL, ALTE, POSC, GEOG, LOPH, ENVE
\end{filecontents*}
\DTLloaddb{data}{mark.csv}
\begin{document}

\DTLforeach*{data}{\name=Name, \coreOne=Core-1}{
\ \coreOne
}

\end{document}

1 Answer 1

2

I'm not quite sure that I understand what you want, but perhaps you are looking for \csname..\endcsname:

\documentclass[a4paper]{article}

\usepackage{xstring,datatool}

\newcommand{\ENGL}{English}
\newcommand{\ALTE}{Alternative English}
\newcommand{\POSC}{Political Science}
\newcommand{\GEOG}{Geography}
\newcommand{\LOPH}{Logic \& Philosophy}
\newcommand{\ENVE}{Environmental Education}

\begin{filecontents*}{mark.csv}
Name,Core-1,Core-2,EL-1,EL-2,EL-3,Comp
Biki Teron,ENGL, ALTE, POSC, GEOG, LOPH, ENVE
\end{filecontents*}
\DTLloaddb{data}{mark.csv}
\begin{document}

\DTLforeach*{data}{\name=Name, \coreOne=Core-1}{
\csname\coreOne\endcsname
}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .