Questions tagged [datatool]

{datatool} is a tool to create and manipulate databases.

Filter by
Sorted by
Tagged with
5
votes
2answers
86 views

Merge comma separated lists from Datatool

I have tried solving this for some time now but can´t seem to find the solution. I have a document that loads data from a CSV-file using Datatool and I have been trying to combine comma separated ...
1
vote
0answers
38 views

Storing file paths and names in an array or list for use as arguments for \catchfilebetweentags or \insertgraphics [closed]

EDITED SOLVED---Thanks @Skillmon I have a multitude of compartmentalized tex files each with three tags (all built from the same template with the same tag names). The files are 20001.tex, 20002.tex,.....
1
vote
1answer
29 views

Add name and number from data file to each icon

Thank you for this solution of Jasper Habicht - in related topic: Simplify code for repeating same image How can I add No and Name (from my data.tex file) under each image (and maybe use the datatool ...
0
votes
0answers
22 views

create multi column (icon and text) from database

i create pdf file from my data file (see image) Now i want to create multi column with icon and number (get from data file) logo | logo | logo number 1 | number 2 | number 3 logo | logo | logo number ...
0
votes
1answer
22 views

Checking if tikzmark exists on page inside datatool dtlforeach

I would like to check that a list of nodes loaded in a DTL database exist on the current page, where each node has a tikzmark. Including a \iftikzmarkoncurrentpage inside a \DTLforeach returns a ...
1
vote
2answers
79 views

How to make a table from text file?

I have a text file, where every line is a question. I want to take this file and make a questionnaire with it, so I need a loop that takes each line and makes a table line with it, along with a True/...
0
votes
2answers
30 views

Get all values in one column associated with the unique values in another column in a Datatool database

I want to get for each of the unique values of one column (eg, country) all the corresponding values of another column (eg, town). I need to use Datatool for this, as the db changes. For instance in: \...
1
vote
1answer
38 views

Obtain unique values of multiple specific columns from a datatool database

How can I get all the different values of a specific column in a datatool database and the corresponding value in another column? In the following example, I want to get as output: A city of Xland in ...
1
vote
2answers
26 views

Obtain all values of a specific column matching a criteria in a datatool database

How can I get all the names matching a particular value in another column (eg, all names with age 20 are Adam, Dora, Franz)? Name,Town,Age Adam,Xcity,20 Berta,Ytown,30 Cesar,Ztington,40 Dora,Ztington,...
1
vote
1answer
90 views

Generating a caption for the figure automatically

I have hundreds of pictures included in latex file. Is there any way, how to create a caption for each automatically? e.g. file picture1 would have generated a caption picture1. \begin{document} \...
1
vote
3answers
69 views

Reading stored table lines with @starttoc: Problems with superfluous spaces

I want to store table lines with \addtocontents and generate a table afterwards from this entries with \@starttoc. Because \@starttoc uses \begingroup and \endgroup it makes problems with tables (! ...
0
votes
1answer
46 views

Using Data to drive Player (Name, Shirt#) and Position( e.g. Goalkeeper, Center Forward) etc. variables to set up Soccer Lineup

I have a soccer field template and then I have a hardcoded listing of parameters I use to set up their position on the soccer field. I am using 3 parameters :: Jersey Number, Player Name, (First ...
3
votes
1answer
42 views

Misplaced noalign with datatool and booktabs

I experience a (I’m afraid not so original) “Misplaced noalign” with the following example. \documentclass{article} \usepackage{booktabs} \usepackage{datatool} \begin{document} \DTLnewdb{mydb} \...
3
votes
2answers
148 views

datatool creating a matrix with 3x3 data \ DTLforeach

I am using datatool package. Several csv files with data are generated in my project and I create index.csv to use Nested \ DTLforeach. I do not understand how I can assemble a 3x3 / 3x4 or 3x5 matrix ...
2
votes
3answers
95 views

Join databases with datatool

I'm trying to get a function that can take a variable amount of csv files as an argument, and then join them into a single database for Latex's datatool. The databases are all in a uniform format (...
0
votes
0answers
35 views

Appending Text to Each Line of an External File Using expl3 Syntax

Let us suppose I have an external questionfileone.tex file where each line of this external file represents a particular question text. It is something that I can use, for example, as a test database ...
1
vote
1answer
52 views

datatool writes renewcommand instead of updating it

In my MWE I want to update a command via \renewcommand, but instead datatool writes my updated command to the output. In addition my \ifthenelse seems to be always true and therefore execute the "...
5
votes
1answer
168 views

How can this complex command be broken down and explained for someone starting with Tex?

I got this Tex command, as a solution to a different problem and it works. But I have trouble understanding the details of how it works since I'm not that proficient in Latex coding and I want to ...
0
votes
1answer
84 views

Is there an equivalent of datatool's \DTLifhaskey for value?

I'm looking for a way to test if a (non-key) value in a column does exist. I basically want to check if \DTLfetch{db name}{col1 name}{col1 value}{col2 name} is giving me a value from the db or an '...
2
votes
2answers
73 views

datatool's \DTLfetch returns last found value instead 'Undefined Value' if entry is not found

I want to have some condition of what to do if the key that was provided is not in the db. But \DTLfetch does return a value in case it had found one before. How can I catch all the 'x' in this ...
0
votes
1answer
25 views

Return type for \newcommand probably doesn't fit \DTLfetch?

I want to fetch from the csv file with a boolean condition (either give me the fruit or give me the count). The first command (CMDone) works and says "count" and the fetch also works and ...
1
vote
1answer
36 views

DTLgetvalueforkey produces the unnecessary spaces

It seems to me that the instruction below produces some extra space. \documentclass[12pt,a4paper,russian]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[russian]{babel} \...
0
votes
0answers
26 views

sorting with more than one criteria using datatooltk command line

In the section "Sorting Data" found in https://www.dickimaw-books.com/latex/admin/html/sortdata.shtml (from datatool package by Nicola L. C. Talbot), it was explained that we can have more ...
1
vote
0answers
12 views

datatool - Precautions for lines not becoming too long when writing .csv-file/text-file from database?

This question refers to the LaTeX 2ε-package datatool: You can save a database to .csv-file, which is a text-file, via \DTLsavedb{⟨db name⟩}{⟨filename⟩} You can load a database from .csv-file, which ...
1
vote
1answer
35 views

datatool - How can you load database from .csv-file with values tokenized with same catcode-settings as are used by \verb|...|?

I plan to use the package datatool for loading a .csv-file as database: \DTLloaddb[<options>]{<db name>}{<filename>} How to achieve tokenizing values of that database under the same ...
1
vote
0answers
36 views

datatool sorting problem - wrong data type?

I created a very small DB with datatool to store two values at each line of the table. First a running ID and second a generated dimension (converted to mm) which I calculated of the width of each ...
1
vote
1answer
66 views

Importing value from txt-file to tikz

I want to import a value form an txt-File and use it in tikz. But for some reason this is not working (line 25). I was not able to find a workaround like the \protect-command which works for \caption ...
2
votes
1answer
108 views

Multiple conditions in \DTLforeach

I start using database in Latex. Therefore on one hand, I have my .tex database where elements are classified by columns separated by comma. On the other hand I have my document calling elements from ...
3
votes
1answer
53 views

Future variable reference

For a document I am working on I would like to achieve something along the following lines: In the beginning of the document, a summary of the most important parts mentioned in the document are given. ...
0
votes
1answer
40 views

How (if at all) can one use datatool's \DTLforeachkeyinrow in an siunitx table?

\documentclass{article} \usepackage{etoolbox} \usepackage{siunitx} \usepackage{datatool} \DTLnewdb{data} \DTLnewrow{data} \DTLnewdbentry{data}{x}{1} \DTLnewdbentry{data}{y}{2} \DTLnewdbentry{data}{z}...
1
vote
1answer
27 views

Retrieve specific values from csv using Datatool and divide them by each other

So I am loading a csv file that looks something like this: est;dens;mwp ols11;0.1;. ols12;0.09;0.001 I want to use the following code to divide two numbers. I use the .csv in a table, but I also ...
1
vote
1answer
22 views

DTLminforcolumn not working with empty rows

I use datatool to parse a CSV file. I want to use the makro \DTLminforcolumn to calculate the minimum value of a column. This works fine if every row has a value, but not so much, if there are empty ...
1
vote
1answer
84 views

Create a sorted, three-column table from a single column in a CSV file

I have a CSV file that has various columns. One of the columns is called summits. This column contains multiple summits in the following form: Summit name (elevation m) For example Mount Everest (...
1
vote
1answer
42 views

\ifnum for datatool package

I'm trying to write quotes and depending on "males" selected, it needs to change the output. Unfortunately, in the example below it gives me 2skip although it should give me 2males. What am ...
0
votes
1answer
40 views

Attempt to add a select command to datatool running into Runaway error

In connection with a side project, I would like to add a SQL-like select and where to the datatool package. The \DTselect command would allow me to specify a list of columns and an existing table ...
2
votes
2answers
104 views

Using \DTLfetch inside a \href

I'm trying to create a new command in LaTeX that creates a Google Map URL pointing to the coordinates associated with the place specified as a parameter in the called command (a sort of "table ...
0
votes
1answer
56 views

How to do custom ordering with Datatool

So I have some data for a rock climbing guide I'm writing. In the last page I want to list all the routes, sorted by grade. The thing is that the conventional sorting doesn't apply here. Quick ...
2
votes
1answer
43 views

Reading `xticklabels` from file: comma's do not split

The following is a MWE of a plot reading the xticklabels from a file. It works, but the comma's inside the string that is fetched from the file, don't split the string into multiple parts. How do we ...
2
votes
1answer
53 views

Macro to apply a custom command to a conditional datatool definition

This is somewhat of an expansion of the previous question:Macro to apply a custom command across a comma-separated list I'm working on creating a garden journal in LaTex. I have a .csv database file ...
4
votes
1answer
83 views

Build glossaries from csv with datatool using with longnewglossaryentry

I'm trying to build a glossary from a csv using datatool and \longnewglossaryentry. I haven't been able to get this to work. Let's start with something that does compile: \documentclass[10pt, a4paper]{...
2
votes
1answer
60 views

Spreadtab and datatool

I would like to use the spreadtab package in combination with datatool to make calculations within a table. The data is coming from an external file; here is an example (scores.csv): FirstName,...
1
vote
1answer
127 views

Assign a variable for the key-assign-list of \DTLforeach

Please consider the following MWE-1: \documentclass{article} \usepackage{longtable} \usepackage{datatool} \newcommand*{\myKeyOne}{ID} \newcommand*{\myKeyTwo}{First-Name} \newcommand*{\myKeyThree}{...
0
votes
1answer
99 views

A database for a Psalter

I would like to create a book (to be exact a psalter). Basically it is a database issue. I have on one hand a tex document (to be exact currently it's still a word document) with all the psalms and on ...
4
votes
3answers
143 views

How can I remove all rows with larger DTLrowi than 10?

I constantly receive an updated file (year.csv) which should be sorted as shown below. But only the first 10 rows (after sorting) should be shown. The MWE works and I can omit all rows with DTLrowi ...
1
vote
2answers
69 views

datatool DTLgetvalue using foreachitem

The following code is supposed to get values from the first row of mydata.csv and then copy values to a new empty row. I am using foreachitem to pass the key to the DTLgetvalue function. It compiles, ...
1
vote
0answers
28 views

error in \xdef and cedilla accent [duplicate]

Consider the following MWE1: \documentclass{article} \newcommand*{\myOwnCommand}{\c{C}engel} \begin{document} This is my surname: \myOwnCommand. \end{document} MWE1 works just fine. The cedilla is ...
2
votes
2answers
71 views

definition variables inserted as datatool arguments

I'd like to create tikzpicture (animated in fact) that would read numbers from text file and use them either as coordinates or nodes or for further calculations. It seems that datatool package would ...
0
votes
1answer
164 views

Use datatool to process input and pass it further to pgfplots to plot the data

to this question (pgfplots(table) spreadsheet like formulas) I got the comment that it could be done with the package datatool. But actually I have problems passing the data from datatool to pgfplots. ...
0
votes
1answer
48 views

Is it possible to tell datatool to ignore certain characters when sorting?

I am making a index as a ";" separated csv file. The index is sorted with the datatool package. The column which is sorted contains utf8 encoded names, including apostrophes, eg. "'Tis" and "ev'ry". ...
2
votes
2answers
67 views

I want to load data from a file and use it in a figure caption. I have a solution that works in some environments

I want to load data from a file and use it in a figure caption. Found this code (that I've modified slightly to demonstrate it's limitations) which does exactly what I want it to do when it works, for ...

1
2 3 4 5
7