Can somebody help me with a pgfplotstable version of th table.
\documentclass{article}
\begin{document}
\begin{table}
\centering
\begin{tabular}{cc|cc}
\hline
\multicolumn{4}{c}{Header} \\
\hline
\multicolumn{2}{c|}{H1} & \multicolumn{2}{c}{H2} \\
\hline
A & B & A & B \\
1 & 2 & 3 & 4 \\
5 & 6 & 7 & 8
\end{tabular}
\end{table}
\end{document}
Here is my rudimentary attempt which does not produce the desired table.
\documentclass{article}
\usepackage{pgfplots, pgfplotstable}
\usepackage{filecontents}
\usepackage{booktabs}
\begin{filecontents*}{data.dat}
A B A B
1 2 3 4
5 6 7 8
\end{filecontents*}
\pgfplotstableset{% global config, for example in the preamble
every last row/.style={after row=\bottomrule},
}
\begin{document}
\pgfplotstabletypeset[every head row/.style={before row={
\toprule},
after row=\midrule},
]{data.dat}
\end{document}