I have 160 tex files named "regj.tex" for j=1,...,160. Each file contains a table. These tex files do not contain the preamble/begin{document}/end{document}. For example reg1.tex is
\begin{table}[htbp]\centering
\caption{Reg1}
\begin{tabular}{l*{9}{c}}
\hline\hline
&\multicolumn{1}{c}{(1.1)}&\multicolumn{1}{c}{(1.2)}&\multicolumn{1}{c}{(1.3)}&\multicolumn{1}{c}{(2.1)}&\multicolumn{1}{c}{(2.2)}&\multicolumn{1}{c}{(2.3)}&\multicolumn{1}{c}{(3.1)}&\multicolumn{1}{c}{(3.2)}&\multicolumn{1}{c}{(3.3)}\\
\hline
A& 0.0599& 0.172& 0.110& 0.200& 0.574& 0.368& 640.2& 1836.0& 1177.8\\
& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)\\
[1em]
B& -3.181& -2.978& -2.967& -0.875& -0.197& -0.160& -2929.9& -762.1& -641.9\\
& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)\\
[1em]
C& -13.09& -15.68& -15.28& 15.56& 6.904& 8.245& 44234.8& 16538.5& 20827.6\\
& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)\\
[1em]
D& -259451.5& -242691.5& -241750.9& -70803.4& -14782.8& -11638.9&-238755093.5& -59586716.2& -49531616.2\\
& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)\\
[1em]
E& 69993.2& 65360.3& 65152.5& 20567.4& 5081.7& 4387.2& 70028268.8& 20501094.0& 18279814.0\\
& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)& (.)\\
\hline
Number of observations:& 30& 30& 30& 30& 30& 30& 30& 30& 30\\
\hline\hline
\multicolumn{10}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\end{tabular}
\end{table}
I would like to create an executable tex file reg0.tex calling all the tables with a loop. How can I do it?


pgfforpackage, and its\foreachfeature. Note also the build in ... Effect – daleif Oct 24 '15 at 19:24