Questions tagged [datatool]
{datatool} is a tool to create and manipulate databases.
374
questions
1
vote
1
answer
242
views
Importing database (created using datatool) to datatooltk
I have created database (very large database) of questions using datatool as
\DTLnewdb{finitemath}
\long\def\newproblem#1#2#3#4#5#6#7#8#9{%
\DTLnewrow{finitemath}%
\DTLnewdbentry{finitemath}{seq}...
2
votes
1
answer
290
views
datatool: How to load a table from file, rotate or not, then impose predefined headers
This is a follow-up question to my previous one.
In this one, I would like to tackle two cases:
First, load the table as it is while just imposing my own column and row headers.
Second, load the ...
6
votes
1
answer
342
views
How to load a table from file, then transpose it and replace its headers if any?
If I have two types of databases; the first one has raw data with row and column headers, while the second one has only raw data.
I would like to get the desired output shown below through:
1- (in ...
4
votes
0
answers
234
views
Checkboxes and TextFields within Datatool csv tables
I've got a sample csv table with three columns - Pet, Names and Number. It's a list of Cats and Dogs, their respective names and the occurrence of each name.
i.e.
The order of Cats or Dogs in the ...
1
vote
1
answer
60
views
How to get related information from a database?
Hello friends I am not able to get or link the content of Core-1 to look up table content of Core-1 is ENGL when i used \coreOne i am getting output as ENGL, so what will happen if i use \coreOne (i....
3
votes
2
answers
652
views
How to find the smallest number from a given set of numbers?
Is there any package or macro that implements getting the smallest number from a given row of numbers? using ifthen package.
I was not able to get it. Here is my MWE.
\documentclass[a4paper]{...
0
votes
0
answers
141
views
datatool, import from same file or subfile
is it possible to import a database from a normal tabular in the same file or subfile?
im thinking about something like this:
\documentclass{article}
\begin{document}
\begin{tabular}{ccc}
C1 & C2 ...
2
votes
1
answer
698
views
Import CSV file generated from Excel To LaTeX with Datatool with accent
I'm trying to import a .CSV file generated with excel that contais special characters as á, é, í, ó, ú.
I'm using \DTLloadrawdb, but these characters still don't show.
What is the magic trick to do ...
2
votes
0
answers
803
views
Package datatool Error: Can't assign \company : there is no key `*' in data base `*'
Hy, i'm having problem with the \DTLforeach in my table. LaTeX returns the following error:
Package datatool Error: Can't assign \company : there is no key Company' in data baseprodutosAloe'. ...\...
0
votes
1
answer
838
views
datatool error ! Missing number, treated as zero. <to be read again>
My sample.tex is -
\documentclass{article}
\usepackage{datatool}
\DTLloaddb{coefficient}{coefficient.csv}
\begin{document}
\DTLfetch{coefficient}{academicYear}{Estimate}
\end{document}
and ...
5
votes
2
answers
440
views
Error with latest version of datatool package
With the latest version of the datatool package, if I compile this file
\begin{filecontents*}{\jobname.csv}
x,y
11,12
\end{filecontents*}
\documentclass{article}
\usepackage{datatool}
\DTLloaddb{...
3
votes
1
answer
354
views
Alignment in first row, first column of table generated by DTLforeach
I have a simple table:
\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{table}[ht]
\centering
\begin{tabular}{c c}
\hline\hline
x & y \\ [0.5ex]
\hline
1 &...
2
votes
2
answers
135
views
How to retain certain LaTeX commands in a datatool database?
I'd like to create the following table using datatool:
\documentclass{article}
\begin{document}
\begin{tabular}{ *{3}{r} }
\bfseries FieldA & \bfseries FieldB & \bfseries FieldC \\
...
6
votes
1
answer
556
views
DTLgetvalueforkey works, but DTLfetch doesn't
In the following example \DTLgetvalueforkey retrieves the information without problem, while \DTLfetch fails:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
...
1
vote
0
answers
65
views
datatool & etoolbox - more expansion shenanigans
This is the code in question:
\documentclass{article}
\usepackage{etoolbox}
\usepackage{datatool}
\usepackage{longtable}
\usepackage{fp}
\def\initialValue{10}
\DTLnewdb{thisEntryDBWarehouse}
\...
3
votes
2
answers
338
views
How do I get datatool to play nicely with utf8 inputenc and non-ASCII in the incoming CSV?
If I try to compile the following LaTeX file:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{datatool}
\begin{document}
\tableofcontents
\appendix
\section{Bill of Materials}
\...
2
votes
1
answer
379
views
TikZ: Using imported data to customize node and path styles
I would like to automatically adapt the features of a flow diagram depending on my data. Here the example is for line widths, but I would like to use the same principle also for node sizes.
I have ...
1
vote
1
answer
489
views
Sorting data in datatool depending on argument
I'm pretty new on latex programming (I used quite a lot for writing text).
I'm trying to insert data on a datatool database and then sort the data according to one of the fields. However, if this ...
2
votes
1
answer
141
views
Tables, Datatool: use "&" in true part of \DTLif
I am trying to create a table with two different types of rows using a csv file.
The csv looks like this
Data1,Data2,Data3
Caption1,,
Value1,Value2,Value3
Value4,Value5,Value6
Caption2,,
Value8,...
1
vote
1
answer
58
views
Output of a tex file is sorted tex file after compilation?
I am using data tool to create the database of questions, where I provided Tag to every question. All database files(50 files) are included in one master file while compiling.After compilation output ...
2
votes
1
answer
765
views
when loading a new database in datatool only the first key works
I try to load a .csv into my .tex using datatool, but it uses only the first given key and I just don't get why.
first lines of my example foobar.csv:
1;a;ax
2;b;be
2;c;ck
3;d;do
(at the end the ...
0
votes
1
answer
89
views
How to make \ifdefempty on datatool entries work in \longtabu?
I have a .csv-file, which I want to make into a table using the datatool-package. The .csv-file ist structured like
foo&bar&foobar
where several lines are grouped together and only the first ...
3
votes
2
answers
302
views
How to find the position of a word in a jumbled sentence?
I have an initial sentence:
The quick brown fox jumps over the lazy dog.
I have a new sentence (which is always a jumble of the original sentence):
The lazy dog jumps over the quick brown fox.
In ...
0
votes
1
answer
1k
views
display a csv file in LaTeX [closed]
How can I link a csv file, and display the data in separate columns ?
\documentclass{article}
\usepackage{makeidx}
\usepackage{datatool}
\DTUoaddb[keys=c1,c2,c3]{ctext}{csvtext.csv}
\begin{document}
\...
5
votes
3
answers
425
views
How to generate key value macro from csv file?
I have a CSV file with key-value pairs, and I want to be able to read the file into latex, and generate macros to access the values. Here is my current attempt with datatool:
\documentclass{article}
...
1
vote
1
answer
445
views
Datatool \DTLnewdbentry does not take value for key column
I am quite frustrated about the following: Iam writing a document with requirements which have requirement IDs as a beginning of a line (I'm using these in an enumerate environment).
I want to collect ...
1
vote
1
answer
329
views
Custom Alphabetic CSV Sorting (Turkish Characters)
I have a CSV list with Turkish names and ages.
I want to sort it in ascending alphabetical order. However, Turkish characters seem to break the sorting.
Another question would how to insert line ...
1
vote
1
answer
239
views
How to make uppercase letter from data reads from .csv file using datatool?
I want to make the data from \g to be converted to uppercase letter then I want to use that data for comparison commands like \IfStrEq{\g}{F}{}{} because in \g it may contain f or F; if it contains f ...
1
vote
1
answer
211
views
Unable to truncate total sum of a row in longtable
I was able to truncate the last row using \DTLtrunc command but this command is not working for last column to truncate the number, here is my MWE.
\documentclass[10pt,a4paper,landscape]{article}
\...
0
votes
0
answers
165
views
How do I remove extra row generated in longtable? [duplicate]
I don't know why this happen in longtable its generated extra row at the bottom of the table which is unwanted row, Please somebody help me to solved this problem here is my MWE
\documentclass[10pt,...
7
votes
2
answers
1k
views
How to count the occurence of M and F in a particular column , No. of male and female deaths?
how to command LaTeX to count occurence of M and F in a particular column of a table from first row to last row of a particular column? And also the number of Male Deaths and Number of Female Deaths,
...
4
votes
1
answer
359
views
datatool package: wishing for keys / column names with special characters, can't get it to work
I wish to read a CSV file that has special characters in the headers. While I got what the documentation says about special characters in the body of the file, I couldn't get it to work for the column ...
4
votes
2
answers
168
views
Creating a database containing numbered blocks of TeX-code
I want to create a database consisting of numbered blocks of TeX-code. In particular, I want to do sth like \mycommand{counterName}{Some text} and save a new entry somewhere, to use the Some Text ...
2
votes
1
answer
330
views
How to map special characters in CSV to something else when processing via datatool
The datatool user guide mentions that certain special characters are automatically mapped to the typesetting equivalent when loading a database in raw mode (via \DTLloadrawdb). If you want to change ...
6
votes
2
answers
492
views
Read cell value from string array and it assign to macro
How it is possible to read some value from string array and assign it to macro
\documentclass{article}
\usepackage{readarray}[2016-11-07]
\begin{filecontents*}{myfile.txt}
Alfred; Koch
Mildred; Jane
\...
9
votes
3
answers
313
views
Datatool gobbling spaces
I've come across a strange problem with datatool. If the first character of the first column of a row is immediately followed by a space, that space gets gobbled somehow. Am I doing something wrong ...
2
votes
0
answers
423
views
Error when importing UTF-8 encoded csv file containing "æ,ø,å" with datatool [duplicate]
I am trying to import a UTF-8 encoded csv file into a tabularx environment to sort the table in ascending order with respect to the first column. When compiling I get the error: Package inputenc Error:...
6
votes
2
answers
459
views
Datatool - Fill Variable (name in first row) with value of second row
I have a csv with 2 rows. the first row contains names and the second row the value. i want to create variables (tried it with newcommand) that have the Name of the first row and define them with the ...
1
vote
1
answer
277
views
Tables in chunks of 25 rows
I need to import some data into a LaTeX document form CSV file, using, as suggested in many sites, datatool package.
But I would divide this data in many tables, in this manner:
Table #1
========
...
3
votes
3
answers
285
views
How to test values in an \ifnum, that are generated from a csv file via \newcommand and \csvreader?
I would like to conditionally print something in a report, based on whether there was a non-zero data point or not (for this example, \DepthOne and \DepthThree are to be tested).
I start by reading ...
6
votes
1
answer
411
views
Unexpected result from trying to use \ce{} from mhchem package with a command defined by \DTLgetvalue from the datatool package
I have a CSV file with a list of chemical compounds I would like to have parsed through the \ce{} from the mhchem which converts them to nice chemical notation. While using the raw string as an ...
6
votes
1
answer
259
views
Datatool query database \dtlgetrowindex argument expansion
I am building a database to gather information from various places of my document. I would like to do the following: query database to look for a row with specific value for a key. If such a row is ...
2
votes
1
answer
103
views
datatool: How to comment inside cell entry?
In this MWE, I need to suppress the output of comment written inside the cell entry. In other words, I need to make a placeholder for comments inside cells of my interest.
\RequirePackage{...
4
votes
1
answer
402
views
datatool and longtable
i want to print a longtable from a contact list with datatool package. The database has some special characters. This is a small example:
\newcommand{\inputfile}{dbase/a.csv}
\documentclass[a4paper,...
3
votes
1
answer
522
views
retrieving substring of `\DTLfetch`
I've been trying to get to the substring of a value retrieved by datatool's, macro \DTLfetch, but I am unable to control the expansion here. I've tried some \expandarg \fullexpandarg as well as some \...
2
votes
2
answers
443
views
How to conditionally shade / color a table row using datatool?
I have been trying to shade an entire row in a table conditionally on the value of an specific entry in that row.
I was trying to adapt the "stripy table" example in datatool, but it seems that I am ...
1
vote
0
answers
119
views
Datatooltk doesn't show text in greek
I would like to create a database of exercises using the datatooltk program along with the datatool package. My text is in greek and this is a snapshot of two exercises written within datatooltk in a ...
3
votes
0
answers
64
views
How to create template longtable/datatool code?
Consider the MWE below (TexLive '15, pdflatex). I have multiple datafiles which need to be displayed in different tables. Currently I have copied table code like MWE multiple times.
Q1: But, what is ...
0
votes
1
answer
238
views
Convert number letters to counter compatible numbers? (datatool, newcounter)
I read in some data from a CSV file with datatool like that:
\documentclass{article}
\usepackage{datatool,filecontents}
\begin{filecontents*}{test.csv}
STUFF,NUMBER
"twentyfour",24
"thirtyone",31
"...
3
votes
1
answer
560
views
Load CSV file + landscape
I hope someone is able to help me. I'm trying to create landscape pages, that are holding my survey items. After several tries with CSV files, I wrote everything by hand, but it's just too inflexible, ...