pgfplotstable can write the output latex code to a file, if you need. Consider this example:
\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{filecontents}
\begin{filecontents*}{test.csv}
A,B,C
0,0,T
1,1,T
2,2,T
3,3,T
4,4,T
5,5,T
\end{filecontents*}
\pgfplotstableread[col sep=comma]{test.csv}\mytable
\begin{document}
\pgfplotstabletypeset[outfile=mytable.out.tex, % ----->write latex code to the file.
begin table=\begin{longtable},
end table=\end{longtable},
every head row/.style={before row=\toprule,after row=\midrule\endhead},
every last row/.style={after row=\bottomrule},
columns/A/.style={int detect,column name=A},
columns/B/.style={int detect,column name=B},
columns/C/.style={string type,column name=C},
columns={A,B,C},
]\mytable
\end{document}
Note the outfile=mytable.out.tex, directive in the code. pgfplotstable writes the latex code to the file mytable.out.tex in the same folder as your other auxiliary files. The contents of mytable.out.tex will be
\begin {longtable}{ccc}%
\toprule A&B&C\\\midrule \endhead %
\pgfutilensuremath {0}&\pgfutilensuremath {0}&T\\%
\pgfutilensuremath {1}&\pgfutilensuremath {1}&T\\%
\pgfutilensuremath {2}&\pgfutilensuremath {2}&T\\%
\pgfutilensuremath {3}&\pgfutilensuremath {3}&T\\%
\pgfutilensuremath {4}&\pgfutilensuremath {4}&T\\%
\pgfutilensuremath {5}&\pgfutilensuremath {5}&T\\\bottomrule %
\end {longtable}%
When you submit your paper to the journal, replace \pgfplotstabletypeset[..]{..}\mytable with the contents of mytable.out.tex as usual (you may \input{mytable.out.tex}).
For more details, search outfile in the pgfplotstable manual. In my copy, it is discussed in detail in page 22.
\pgfutilensuremathby\ensuremath, I had to remove\pgfplotstableresetcolortbloverhangrightand\pgfplotstableresetcolortbloverhangleft. I think these are caused by thedec sep alignoption. There are some slight spacing issue when simply removing them. – M. Toya Jul 24 '13 at 07:45outfile=mytable.out.texin combination withtypeset=falseand\include{mytable.out.tex}. The optiontypeset=falsewill only generate the outfile without including the table right in place. So I split all the table generation stuff in to another file and later do the includes in place where needed. Before publishing I exclude the table generation file and do some replacing e.g.\pgfutilensuremathby\ensuremathand remove thepgfplotstableimport in the preamble – David Boho Jun 27 '18 at 08:01