i have 2 filecontent with different structure: test1.tex and test2.tex.
But i want to call data from only one file (ex:test.tex)
How can i build only one file test.tex that includes data of 2 file test1.tex and test2.tex?
My minimal code:
\documentclass{article}
\usepackage{datatool}
\usepackage{filecontents}
\usepackage{pgfplots}
\usepackage{pgf}
\usepackage{tikz}
\begin{filecontents*}{test1.tex}
Acol, Bcol, NoCol
Ax,Bx,1
Ay,By,3
A1,B22,2
A2,B44,4
A3,B11,5
\end{filecontents*}
\begin{filecontents*}{test2.tex}
\def\Names{{"ABC","XYZ"}}
\end{filecontents*}
\DTLloaddb{mydata}{test1.tex}
\input{test2.tex}
\pgfmathsetmacro{\NameNull}{\Names[0]}
\begin{document}
\DTLforeach*{mydata}{\A=Acol,\B=Bcol}%
{%
\NameNull \hspace{2cm } \A \hspace{2cm } \B \\
%\newpage
}%
\end{document}
i can manual copy all data from test1.tex and test2.tex to one file test.tex.
But please help how i arrange this data?
Ex:
\begin{filecontents*}{test.tex}
Data copy from test1.tex and can call to main.tex
Data copy from test2.tex and can call to main.tex
\end{filecontents*}
Thanks
test1.tex(which is not a TeX file, rather CSV) andtest2.tex. What else do you want? Do you want to read two files in CSV format fromtest.tex? If so, I think you have to process them one by one, with two calls to\DTLforeach*, each corresponding to a different database (e.g.,\DTLloaddb{mydata1}{test1.tex}and\DTLloaddb{mydata2}{test2.tex}). – frougon Aug 26 '19 at 22:01\inputtest1.tex and test2.tex from test.tex, then test1.tex and test2.tex can't have\documentclass,\begin{document},\end{document}. When LaTeX processes one document, it must see one occurrence of these commands, no more. So, you can have a skeleton document in test.tex with two\inputcommands for test1.tex and test2.tex, but then these two files can't be full compilable documents: they can only be partial. For instance, they can contain macro definitions and you can use the macros in test.tex. – frougon Aug 27 '19 at 12:32