What do I have to do, if I want to have a 'gap' or a word e.g. 'zero' in a cell, if it's value is equal to 0?
preproc/expr={##1==0 ? "111" : "##1"}
works but something like preproc/expr={##1==0 ? "{}" : "##1"}
or preproc/expr={##1==0 ? "zero" : "##1"}
does not work.
\documentclass[border=2pt, varwidth]{standalone}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread{
1 1
2 {}
3 0
4 4
5 0
6 5
7 6
}\test
The Table: \pgfplotstabletypeset[]{\test} \\
Actual: \pgfplotstabletypeset[
%string type,
columns/1/.style={
% Works fine
preproc/expr={##1==0 ? "111" : "##1"},
% Does not work:
%preproc/expr={##1==0 ? "{}" : "##1"},
%preproc/expr={##1==0 ? "zero" : "##1"},
},
]{\test}
%
Target 1: \begin{tabular}{r r}
1 & 1 \\
2 & {} \\
3 & {} \\
4 & 4 \\
5 & {} \\
6 & 5 \\
7 & 6 \\
\end{tabular}
%
Target 2: \begin{tabular}{r r}
1 & 1 \\
2 & {} \\
3 & zero \\
4 & 4 \\
5 & zero \\
6 & 5 \\
7 & 6 \\
\end{tabular}
\end{document}