I am a newbie with latex
I have a file, just for test, ListeEleves.csv
nom,prénom
Avogadro,Amédéo
Bohr,Niels
Copernic,Nicolas
Einstein,Albert
I would like to get
nom,prénom,ID,IDInitials
Avogadro,Amédéo,Avogadro-Amedeo,Avogadro-A
Bohr,Niels,Bohr-Niels,Bohr-N
Copernic,Nicolas,Copernic-Nicolas,Copernic-N
Einstein,Albert,Einstein-Albert,Einstein-A
my code
\documentclass[10pt,a4paper,french]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array,multirow,tabularx}
\usepackage{datatool}
%\DTLsetseparator{;}
\usepackage{fp,pgf,tikz}
\usepackage{ifthen,multido}
\usepackage{babel}
\begin{document}
\DTLloaddb{ListeEleves}{ListeEleves.csv}
\DTLforeach{ListeEleves}{\nom=nom,\prenom=prénom}{%début for each
\DTLforeachkeyinrow{\ItemLu}{%début de for each key in row
%\ifthenelse{\dtlcol >2}{\dtlbreak}{%on limite la lecture aux deux premières colonnes
%suppression des lettres accentuées
\DTLsubstituteall{\ItemLu}{À}{A}
\DTLsubstituteall{\ItemLu}{à}{a}
\DTLsubstituteall{\ItemLu}{Â}{a}
\DTLsubstituteall{\ItemLu}{â}{a}
\DTLsubstituteall{\ItemLu}{È}{E}
\DTLsubstituteall{\ItemLu}{è}{e}
\DTLsubstituteall{\ItemLu}{É}{E}
\DTLsubstituteall{\ItemLu}{é}{e}
\DTLsubstituteall{\ItemLu}{Ê}{E}
\DTLsubstituteall{\ItemLu}{ê}{e}
\DTLsubstituteall{\ItemLu}{Î}{I}
\DTLsubstituteall{\ItemLu}{î}{i}
\DTLsubstituteall{\ItemLu}{Ï}{I}
\DTLsubstituteall{\ItemLu}{ï}{i}
\DTLsubstituteall{\ItemLu}{Ü}{U}
\DTLsubstituteall{\ItemLu}{ü}{u}
\DTLsubstituteall{\ItemLu}{Û}{U}
\DTLsubstituteall{\ItemLu}{û}{u}
\DTLsubstituteall{\ItemLu}{Ù}{u}
\DTLsubstituteall{\ItemLu}{ù}{u}
\DTLsubstituteall{\ItemLu}{Ô}{o}
\DTLsubstituteall{\ItemLu}{ô}{o}
\DTLsubstituteall{\ItemLu}{'}{}
\DTLsubstituteall{\ItemLu}{ }{}
%fin suppression des lettres accentuées
%}%
\DTLifeq{\dtlcol}{1}{\FPset\NOM{\ItemLu}}{\relax}
\DTLifeq{\dtlcol}{2}{\FPset\PRENOM{\ItemLu}}{\relax}
}%fin de for each key in row
\NOM \PRENOM
}%fin for each
\DTLdisplaydb{ListeEleves}
\end{document}
1) Is it a more easier way to encode lines \DTLifeq{\dtlcol}{1}{\FPset\NOM{\ItemLu}}{\relax}
and \DTLifeq{\dtlcol}{2}{\FPset\PRENOM{\ItemLu}}{\relax}
2) I can not manage to automatically add a new entry/column with
\DTLnewdbentry{ListeEleves}{ID}{\NOM-Prenom}
even \dtlgetentryfromcurrentrow
or \dtlreplaceentryincurrentrow
3) \DTLstoreinitials{\Ini}{\PRENOM}
does not work with a command name
Do you have any idée ?
Thanks