Menu

#4 Detect and handle empty column names

Unstable (example)
closed-fixed
nobody
None
5
2013-06-21
2012-11-15
Jake
No

PGFPlotstable can't deal with empty column names. The following example fails with the error message "! Package pgfkeys Error: I do not know the key '/pgf/number format/columns//.try/.try'":

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset[col sep=comma]{
A,,C,,E
1,2,3,4,5
6,7,8,9,10
}
\end{document}

I've modfied the \pgfplotstableread@impl@collectcolnames@NEXT function found in pgfplotstableshared.code.tex to detect empty column names and replace them with the string "empty", which fixes the error and allows for the column to be accessed with the usual methods.

Discussion

  • Jake

    Jake - 2012-11-15

    Patch for PGFPlotstable to handle empty column names

     
  • Christian Feuersänger

    • status: open --> closed-fixed
    • Group: --> Unstable (example)
     
  • Christian Feuersänger

    Fixed. Thanks for the report and the excellent pre-analysis.

    Now, pgfplots issues a warning (which can be turned off) and assigns the column index to such a column.