Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory.
I want to input all files from within my main LaTeX document. Actually I can create a list of those files using C# in advance.
To enrich my view about LaTeX or TeX, could you tell me whether or not this job can be done only by using pure TeX or LaTeX?
The following code, that was made by Herbert and adapted by Paulo, has been tested and it works successfully on Windows. A good day!
\documentclass{minimal}
\makeatletter
\def\app@exe{\immediate\write18}
\def\inputAllFiles#1{%
\app@exe{cmd /c dir /b *.tex > \jobname.tmp}%
\InputIfFileExists{\jobname.tmp}{}
\AtEndOfDocument{\app@exe{rm -f #1/\jobname.tmp}}}
\makeatother
\begin{document}
\inputAllFiles{.}% from the current dir
\end{document}


\app@exe{cmd /c dir /b *.txt > \jobname.tmp}in Herbert's answer. On a sidenote, his code does work in Windows if you have the proper *nix tools provided by Cygwin or MSys. IMHO those tools give us more confidence than their Windows counterparts. – Paulo Cereda Jul 30 '11 at 19:55