[Tex/LaTex] pgfplotstable: not printing string type values

pgfplotstable

I have some data in a csv file I wanted to turn into a table, but pgfplotstable does not print any string type values.
All I'm getting is the numbers, but I also need those string values.

The example is from here.

table with stuff missing

MWE:

\documentclass{article}

\listfiles
\usepackage{filecontents}
\usepackage{pgfplotstable}

\begin{filecontents}{data.csv}
Name,Surname,Age
Albert,Einstein,133
Marie,Curie,145
Thomas,Edison,165
\end{filecontents}

\begin{document}

\begin{tikzpicture}
\pgfplotstabletypeset[
    col sep=comma,
    header=has colnames,
    columns={Name,Surname,Age},
    columns/Name/.style={column type={c|},string type},
    columns/Surname/.style={column type={c|},string type}, 
]{data.csv}

\end{tikzpicture}
\end{document}

Best Answer

This happens because you're wrapping the \pgfplotstabletypeset command in a tikzpicture (I'm surprised that there is any output at all). Remove the tikzpicture, or put the \pgfplotstabletypeset command in a \node:

\documentclass{article}

\listfiles
\usepackage{filecontents}
\usepackage{pgfplotstable}

\begin{filecontents}{data.csv}
Name,Surname,Age
Albert,Einstein,133
Marie,Curie,145
Thomas,Edison,165
\end{filecontents}

\begin{document}
\pgfplotstabletypeset[
    col sep=comma,
    header=has colnames,
    columns={Name,Surname,Age},
    columns/Name/.style={column type={c|},string type},
    columns/Surname/.style={column type={c|},string type}, 
]{data.csv}
\end{document}
Related Question