1

I am trying to create a table where the values for each column is read from a log file. I am trying this simple piece of code:

    \documentclass{article}

\usepackage{pgfplotstable}

\begin{document}
\pgfplotstableread{h1_error.log}\dataA
\pgfplotstableread{l2_error.log}\dataB

\pgfplotstablecreatecol[copy column from table={\dataB}{[index] 0}] {par1} {\dataA}
\pgfplotstablecreatecol[copy column from table={\dataB}{[index] 1}] {par2} {\dataA}

\pgfplotstabletypeset{\dataA}
\end{document}

where the log files look like h1_error.log=

<#N      H1 error
40  0.231438
#N       H1 error
40  -nan
#N       H1 error
40  0.231438
#N       H1 error
5   1.32218
#N       H1 error
5   1.60331
 > 

and l2_error.log=

<
#N       L2 error
40  0.00624957
#N       L2 error
40  0.00809222
#N       L2 error
40  0.00624957
#N       L2 error
5   0.246561
#N       L2 error
5   0.307461
>

but I keep getting,

I do not know the key '/pgf/number format/copy column from table' and I am going to ignore it. Perhaps you misspelled it.

if I only use

\begin{document}
\pgfplotstableread{h1_error.log}\dataA
\pgfplotstabletypeset{\dataA}
\end{document}

I get what I want

enter image description here

Anyone knows whats going on? thanks in advance.

3
  • Try typesetting the data first to see what got read in. And use [string type]. May 15, 2017 at 19:52
  • @JohnKormylo I have edited the question, I guess now its clear.
    – Noname
    May 15, 2017 at 20:01
  • They are column names
    – Noname
    May 15, 2017 at 20:29

1 Answer 1

2

I get no error from the following MWE.

\documentclass{article}

\usepackage{pgfplotstable}

\begin{document}
\pgfplotstableread[header=has colnames]{
0  1
40 .23
40 nan
40 .23
5  1.32
5  1.6
}\dataA

\pgfplotstableread[header=has colnames]{
0  1
40 .23
40 nan
40 .23
5  1.32
5  1.6
}\dataB

\pgfplotstablecreatecol[copy column from table={\dataB}{[index]0}] {par1} {\dataA}
\pgfplotstablecreatecol[copy column from table={\dataB}{[index]1}] {par2} {\dataA}

\pgfplotstabletypeset{\dataA}
\end{document}
3
  • When I just copy and paste above MWE, I can't compile using TexMaker 4.5 :( and can't see any pdf :(
    – Noname
    May 16, 2017 at 6:52
  • Using the above MWE, I keep getting [Package pgfkeys Error: I do not know the key '/pgfplots/table/copy/column fro m table' and I am going to ignore it. Perhaps you misspelled it.] Anyone has an idea about what is going on? I am on Mac computer and compiling the tex file using Texmaker 4.5
    – Noname
    May 16, 2017 at 7:57
  • You probably need to update your packages. May 16, 2017 at 12:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .