Debian Codegraph @

texmf-dist/doc/latex/datatool/datatool-user-examples/datatool-user-example103.tex

raw
1 % This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04
2 % Example 103 Sorting Data Using \DTLsortdata on Age then Surname (Empty or Null Values)
3 % Label: "ex:sortcsvage"
4 % arara: pdflatex
5 % arara: pdfcrop
6 \documentclass[12pt]{article}
7 \pagestyle{empty}
8 \begin{filecontents}[noheader,overwrite]{customers.csv}
9 Id,Organisation,Surname,Forename,Email,Age
10 1,,Parrot,Polly,[email protected],42
11 2,University of Somewhere,Canary,Mabel,[email protected]
12 3,University of Somewhere,Zebra,Zoë,[email protected],21
13 4,Zinnia Florestry,Arara,José,[email protected],42
14 5,,Duck,Dickie,[email protected],
15 6,Newt Fellowship,Axolotl,Lizzie,[email protected]
16 7,Avian Emporium,Canary,Fred,[email protected],19
17 8,Newt Fellowship,,Molgina,[email protected]
18 9,,Mander,Sally
19 10,Élite Emporium,Fant,Eli,[email protected],101
20 \end{filecontents}
21
22 \usepackage{datatool}
23 \DTLsetup{store-datum,default-name=customers}
24 \DTLread{customers.csv}
25 \begin{document}
26 \DTLsortdata{customers}{Age,Surname}
27
28 \DTLaction{display}
29 \end{document}