![Convertir día de la semana a número](https://rvso.com/image/392355/Convertir%20d%C3%ADa%20de%20la%20semana%20a%20n%C3%BAmero.png)
fabricante de textiles,
¿Cómo puedo cambiar el día de la semana del contenido del archivo para mostrar el número?
Lunes = 2, Martes = 3...Sábado = 7, Domingo = 1
Mi código
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{file.tex}
%Type =1,2...10
No,Dayofweek,Name
1,Monday,A
2,Tuesday,B
3,Wednesday,D
30,Thursday,C
31,Friday,M
131,Saturday,N
132,Sunday,K
\end{filecontents*}
\usepackage{datatool}
\DTLloaddb[autokeys=false]{file}{file.tex}
\begin{document}
Display Dayofweek => Number
\DTLforeach*
{file}% Database
{\No=No,\Dayofweek=Dayofweek,\Name=Name}{%
\noindent\Dayofweek \quad \Name\par
}%
\end{document}
Respuesta1
Si entendí bien la pregunta...
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{file.tex}
%Type =1,2...10
No,Dayofweek,Name
1,Monday,A
2,Tuesday,B
3,Wednesday,D
30,Thursday,C
31,Friday,M
131,Saturday,N
132,Sunday,K
\end{filecontents*}
\usepackage{datatool}
\DTLloaddb[autokeys=false]{file}{file.tex}
\newcommand\Sundaycode{1}
\newcommand\Mondaycode{2}
\newcommand\Tuesdaycode{3}
\newcommand\Wednesdaycode{4}
\newcommand\Thursdaycode{5}
\newcommand\Fridaycode{6}
\newcommand\Saturdaycode{7}
\newcommand\daycode[1]{\csname #1code\endcsname}
\begin{document}
Display Dayofweek $=>$ Number
\DTLforeach*
{file}% Database
{\No=No,\Dayofweek=Dayofweek,\Name=Name}{%
\noindent\daycode{\Dayofweek} \quad \Name\par
}%
\end{document}