I have searched for solution to my problem on using pgfplotstable, but I didn't find nothing useful.
I'm using pgfplotstable to import csv data into my latex code. My table has four columns. The first one is has string data and the others has numeric values.
I indicated the column type for the first column string, then get the following message - error(1):
! Missing $ inserted. $ l.17 ]{teste.csv}
The data are in the file teste.csv
If I remove the string type style from the first column, I get the following error (2):
! Package PGF Math Error: Could not parse input 'B030_01' as a floating point number, sorry. The unreadable part was near 'B030_01'..
My latex code:
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage[utf8]{inputenc}
\pgfplotsset{compat=1.9}
%\pgfplotstableread[col sep=tab]{teste.csv}\mytable
\begin{document}
\pgfplotstabletypeset[col sep=tab,
columns={Instance,CAP,CUSTO,TIME}
columns/Instance/.style={string type} % if commented get error 2, else get error 1
]{teste.csv}
\end{document}
My data table:
Instance CAP CUSTO TIME
B030_01 3 15673 0.136264
B030_02 3 16732 0.143577
...
B030_28 8 99998.5 1.28447
B030_29 17 93604.5 1.110965
B030_30 17 96460.5 1.19836
Maybe, the error could be very simple, but until now I didn't figure it out.