Questions tagged [csv]

The CSV tag concerns text-based files containing tabular material using commas as a separator.

Filter by
Sorted by
Tagged with
46
votes
5answers
104k views

Importing csv file into latex as a table

I am using the \csvautotabular function to import data from a csv file. It has worked beautifully; however, I only want to import certain columns from the file. How can I exclude certain columns? ...
46
votes
3answers
64k views

How to plot data from a CSV file using tikz and csvsimple?

Here is a minimal example : \begin{filecontents*}{data.csv} a,b,c,d 1,4,5,1 2,3,1,5 3,5,6,1 4,1,4,9 5,3,4,7 \end{filecontents*} \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{...
12
votes
2answers
1k views

Combine columns of a csv

I'm attempting to use \pgfplotstabletypeset but with no luck. I have a CSV file like the following: Name, Age, stDev Adam, 15, 3 When I output in this into my PDF, I would like the last two columns ...
12
votes
1answer
489 views

Render rfc4180 compilant CSV as table

Is there a LaTeX package, which would import data from csv and honour the quotation escaping? To be exact I mean one using the rules 1. - 7. of http://tools.ietf.org/html/rfc4180#section-2 Neither ...
11
votes
3answers
2k views

How can CSV files be put into LaTeX without having to adjust much?

I would like to have a TeX-Snippet that takes a filename as an argument and outputs a table with toprule and bottomrule: \begin{tabular}{lrr} \toprule Fach & Dauer & Einkommen\\ ...
10
votes
4answers
18k views

How to compute an histogram (plot bars) binning the values from a .csv using TeX?

I've a .csv with a column of acquired measures. I would like to make the histogram bins using TeX from the measures distribution so I have to create the bins first. I haven't found any reference to ...
9
votes
2answers
8k views

Importing CSV file as a table in Latex but file too long

I am trying to import a CSV file but the data in the table is too long it goes down till the end of the page and disappears without continuing on the next page. Here's the file: \begin{filecontents*}...
9
votes
1answer
17k views

PGFplotstable: using a csv file with 4 columns

Suppose I have a csv file with no titles in it just data. The first column is time (x axis) and the next 3 columns each construct a different set; that is, plot(t, col1) is one set of data, plot(t, ...
9
votes
2answers
2k views

How to annotate TikZ plotted function using axis values?

I would like to annotate local max of a .csv spectrum. My goal is to have a latex plot analogous of the matplotlib script I use, which give me this result: I've plotted the same spectrum from this ....
9
votes
1answer
992 views

Huge table/matrix with colored boxes

I have a huge CSV file with about 25.5k records that (structurally) looks like the sample below. In essence, I want to display the values of the columns U,V,W,X,Y,Z of each row as a colored box. The ...
9
votes
1answer
622 views

Grouping data in pgfplots

I have a file with measurement results for different settings (group) in a single csv file as shown below. I would like to plot a line in pgfplots for each group and provide an appropriate legend. Is ...
8
votes
5answers
8k views

Are there tools for importing from CSV to BibTeX?

I'm seeking a way to get my books database, stored on Goodreads, into BibTeX form. As near as I can tell, Goodreads provides no support for this directly, but does provide for CSV export (on the right)...
8
votes
4answers
7k views

Sending Same Letter to multiple addresses

I'm sending the same letter to multiple addresses. The addresses are stored in a csv document. I've so far created a loop to create multiple letters, but I have not been successful in finding a ...
7
votes
3answers
293 views

How to run multiple compilations of a document with different CSV input files

I have the following document: \documentclass[a4paper,10pt]{article} \usepackage{pgfplotstable, booktabs} \pgfplotsset{compat=1.14} \pagenumbering{gobble} \begin{document} \begin{center} \...
7
votes
3answers
10k views

How to transform Google docs tables into Latex Tables?

I usually do all of my tables using Google Docs spreadsheet. This is a good and quick way to organize information and create quick tables. Now I am writing a document in Latex and I would like to ...
7
votes
1answer
180 views

Why is this CSV form letter code incompatible with the table of contents in ConTeXt?

Using the code in the answer to How to create form letters from spreadsheet data in ConTeXt?, I am building a document from data in a CSV file. I found that some part of the code is incompatible with ...
6
votes
3answers
4k views

Bib file convertion to csv or Excel

I have a large .bib file and need to analyze which keywords are used in which bibliography entry. Therefore I am looking for a "tool" to convert the .bib file to CSV or XLS format. I need a CSV which ...
6
votes
1answer
6k views

Scatterplot with data from CSV file and trendline

I have created a scatterplot with code from this previous asked question. \documentclass[varwidth=true, border=2pt]{standalone} \usepackage[utf8]{inputenc} % this is needed for umlauts \usepackage[...
6
votes
1answer
1k views

csvsimple handles underscores wrong

I try to print a .csv file using csvsimple. The column headers of that CSV file contain underscores. Within the csvsimple documentation, I found the option respect underscore=true option that is ...
6
votes
1answer
2k views

How to deal with csv file whoese fields are enclosed by quote?

I have a csv file whose fields contain text. As fields can contains newlines, they are enclosed by double quotes. Editing these file works well with my favourite spreadsheet (libreoffice). I want to ...
6
votes
1answer
236 views

Multiple instances of xelatex in parallel without overwriting generated PDF's

I've one TeX file abc.tex which is executed using xelatex abc.tex to generate the PDF file abc.pdf Inside abc.tex I'm using the datatool package to read data from an external CSV file (say pqr.csv). ...
6
votes
1answer
78 views

How to add title at custom position in Latex pgfplot?

I tried to add title at custom position of a pgfplot from a CSV (https://drive.google.com/file/d/1xnF8rG9J50ZIxl9K04k6nksvjWoWrfHe/view?usp=sharing) file, but nothing came out. I tried several ways, ...
6
votes
1answer
296 views

Tikz Wheelchart - How do I link a CSV to this graph?

I am trying to connect a CSV file to a wheelchart of the tikzpicture package. The image below looks fine, the only issue is that currently the data entries are hard coded. In the code below you can ...
6
votes
1answer
720 views

Macro for pgfplots/gnuplot exponential regression line

I am trying to create a series of plots with exponential regression that are automatically generated from comma/tab separated .csv files and pgfplots with help from gnuplot. When not using macros I ...
6
votes
1answer
3k views

Plotting graphs from csv with pgfplots?

I am trying to plot a graph using pgfplots in which the data is read from a CSV file. My points show up fine, but when I try to add a regression line, it appears as a vertical line at x=0. Can anyone ...
6
votes
1answer
211 views

Plot bar chart from csv with different styles depending on row in csv

I try to plot the content of a csv file in a bar chart, where depending on the row the bar should have a different style. This is what I came up with so far: \documentclass{article} \usepackage{tikz} ...
5
votes
4answers
203 views

use foreach to read columns from a csv file?

How can I read columns from a external csv file using a foreach statement? e.g. if the content of the csv file is as follows: {0,0,0},black, {1,1,0},yellow, {1,0,1},pink And I would like to use it ...
5
votes
3answers
206 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} ...
5
votes
2answers
472 views

Rendering CSV data in tables which do not fit in paper width

I have to generate a number of tables from CSV data which span a couple of hundred pages or more. So, I need some kind of automation for this. Please note the following salient points: The data has ...
5
votes
2answers
3k views

How can I plot bigger amounts of data?

I am currently playing around with hailstone sequences (collatz numbers). I would like to create a plot like this (from Wikipedia): But I don't know how this kind of plot is called (it's neither a ...
5
votes
2answers
734 views

“escape underscore” environment with csvreader

I want to put the content of a csv file in a tabular environment. However, this includes text with underscores "_". Because this triggers the math environment, it gives the error: Missing $ inserted. ...
5
votes
1answer
715 views

Adjust decimals on table from csv

My problem is that I'm importing some data from a csv and generating a table. The table is good, but I need the numbers with 4 decimals. I've generated the table with this code (probably it is not ...
5
votes
1answer
122 views

Load data into custom tikZ timeline plot from a .csv file

I have created a custom timeline plot in tikz, and am aware of other options for timelines but I need mine to be more customizable. A mwe is shown below. I would like to modify this tex file to read ...
5
votes
2answers
2k views

Create a caption for table using the \csvautolongtable command from the csvsimple package

I successfully included a .csv table using the \csvautolongtable command from the csvsimple package (the table is more than one page, this is why I am using this command). Now I want to add a caption ...
5
votes
1answer
489 views

problematic extra cell when importing CSV to latex

I have a table that spans several pages I will be including in an appendix that I would like to import into my LaTex document from a csv. I found the long table answer post very helpful: Importing CSV ...
5
votes
1answer
698 views

Problem defining a string column with PGFPlotsTable

First, I am fresh new with the PGFPlotTable package! I have the following CSV file that I would like to plot in a LaTeX table: truncatedtime;meanfinalfloatvalue;floatvaluedifference;datap2count;...
5
votes
1answer
4k views

Getting specific row/column values from a csv file to use in text, figures or table cells

I am trying to do the following: read a csv (or other similar format) external file with numerical and string data into an object; reference/get an specific value from such object to use into an ...
5
votes
1answer
450 views

pgfplotstable show subset of rows?

I'm visualizing a csv with pgfplotstable as following: \pgfplotstabletypeset[ string type, col sep = comma, begin table=\begin{longtable}, end table=\end{longtable}, columns={{...
5
votes
1answer
309 views

Plot Gantt-like plot from csv

I am trying to plot a Gantt-like chart with pgfplot from a CSV-File. The aim is to display the behavoir of a task scheduler. In my CSV-File I have tupel of timestamp(x) and task ID(y). \documentclass{...
4
votes
5answers
509 views

\newcommand and CSV file

I have a CSV file which looks like this testa, 123 testb, 456 testc, 789 How can process the CSV file to get the following result? \newcommand{\testa}{123} \newcommand{\testb}{456} \newcommand{\...
4
votes
2answers
937 views

Error while trying to read csv file to create table

I have a csv like the following: CategoryName,Pageviews Restaurants,37951 Shopping,22002 Things to do,20067 Nightlife,10612 Gifts,9194 Food Shopping,8655 Useful Stuff,8536 Parenting ,8353 Home,7654 ...
4
votes
3answers
145 views

Find the locations of blank lines in .csv file

This is related to a previous question I asked - Plotting data blocks of varying length using PGFPlots and gnuplot. Here is a minimum working example: % !TeX TXS-program:compile = txs:///pdflatex/[--...
4
votes
2answers
929 views

Automatically formatting a table from a file with a list of words

I have a list of ~1000 words in a text file. The words are listed in a text file "my_words.txt" with no breaklines as follows: word1, word2, word3, etc. I would like to display these words in a ...
4
votes
2answers
151 views

TikZ: colors stored in matrix with coordinates inferred

I'd like to use data stored in an external CSV file to fill nodes inside a tikzpicture matrix. If my data is stored as x/y/z, I can write the following loop (put together from this and this): \...
4
votes
2answers
279 views

csvsimple vs. conditional row coloring

I've a CSV file what I want process with csvsimple. My desire is to color some rows based on a conditional (one specified column has bigger value). Here is an MWE: \documentclass[12pt]{article} \...
4
votes
1answer
1k views

How to hide one column in a pgfplotstable

How can I hide the column parameter a (header and data) of the following table. \documentclass{article} \usepackage[letterpaper, margin=0.5in]{geometry} \usepackage{pgfplotstable} \begin{document} \...
4
votes
1answer
145 views

How to call specific lines of data in a CSV in ConTeXt?

I have a CSV file, using "@" as the delimiter, containing data such as this: Code @ Title @ Page @ Tags @ File 001 @ Buying Tips @ 1 @ seafood, fish, ...
4
votes
1answer
311 views

How to iterate over a comma separated list passed through the datatool interface

I'm trying to iterate over a comma separated list that is itself inside a cell in a .csv file, which I'm reading and iterating over with datatool. As per, How do I process a comma separated list ...
4
votes
1answer
48 views

Print range of many group rows in datatools

I use this code from this answer: \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{product.tex} %Type =1,2...10 No,Type,Name,Description 1,1,A1,D1 2,1,A1,D2 3,1,A1,D3 30,1,A1,...
4
votes
3answers
587 views

Creating string array from csv file

I would like to create some name badges using a loop. I have a spreadsheet with names and affiliations that I save in names.csv file as follows "Name1","Surname1","Affiliation1", "Name2","Surname2","...