GeneralDatatool : automatically add a new entry

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Datatool : automatically add a new entry

Post by pasbal »

Hello,

1) I would like concatenate prénom (name) and nom (surname) to create a new user name without an accent on letters, like this: Avogadro-Amedeo.
It works, see my post below

2) How can i automatically add a new entry and complete each row.
I tried \dtlupdateentryincurrentrow{\dtlcol}{stuff}, \dtlupdateentryincurrentrow.
It works, see my post below

3) Is it possible that this new entry could be a command ? My idea is not clear yet.
It works, see my post below

Many thanks for help
Last edited by pasbal on Sun Jun 05, 2016 11:18 am, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Datatool : automatically add a new entry

Post by pasbal »

first step : solved

second & third step step : fail

If my file is :

Code: Select all

key1,key2,key3,key4
Amédéo,AVogadro,,
Bohr,Niels,,
In the end, i would like :

Code: Select all

key1,key2,key3,key4
Amédéo,AVogadro,Stuff1,Stuffa
Bohr,Niels,Stuff2,Stuffb

I would like to use a command, like this

Code: Select all

\DTLforeachkey{}{
add a new entry in the column X with \command{argument1}{argument2}
}
I hope my question is totally clear.
Sorry for my bad English.
Attachments
ListeCompetencesEleves.csv
(371 Bytes) Downloaded 215 times
Tests-Competence-5-forum.tex
(3.5 KiB) Downloaded 224 times
pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Datatool : automatically add a new entry

Post by pasbal »

Code: Select all

\DTLforeach{ListeCompetencesEleves}{%
%\dtlexpandnewvalue%
\nom=nom,\prenom=prénom}%
{%
\DTLforeachkeyinrow{\ItemLu}{%
\ifthenelse{\dtlcol>2 \and \dtlcol <\nombredecolonnes}{\DTLreplaceentryforrow{\dtlkey}{value}}%%%%
{\relax}%
}%
}%
If value is a commande name use \dtlexpandnewvalue
Post Reply