So after searching for some hours I'm surprised that there wasn't any useful solution to find.
I import a CSV table using datatool. That table only consists of 3 narrow columns, but I got a lot of rows. I followed the example in the documentation to get two rows in one table row next to each other.
So far that works fine but unfortunately the values read from left to right and not left side top to down and then on the right half top to down.
Let me illustrate my Problem:
|---|---|---|---|
| # |foo| # |foo|
|===|===|===|===|
| 1 |abc| 2 |def|
| 3 |ghi| 4 |jkl|
| 5 |mno| 6 |pqr|
|---|---|---|---|
That's how it is now following the documentation (Example 8, page 47 in datatool.pdf).
What I want to have is
|---|---|---|---|
| # |foo| # |foo|
|===|===|===|===|
| 1 |abc| 4 |jkl|
| 2 |def| 5 |mno|
| 3 |ghi| 6 |pqr|
|---|---|---|---|
Is there any chance to modify that example to give an output like that?
Minimal example
\documentclass[a4paper]{article}
\usepackage{datatool}
\begin{document}
\DTLsetseparator{;}
\DTLloaddb[noheader,keys={id,item}]{test_db}{test.csv}
\begin{table}[htbp]
\caption{Two database rows per tabular row}
\centering
\begin{tabular}{cc|cc}
\bfseries ID &
\bfseries Item &
\bfseries ID &
\bfseries Item
\DTLforeach*{test_db}{\id=id,\item=item}{%
\DTLifoddrow{\\}{&}%
\id & \item}%
\end{tabular}
\end{table}
\end{document}
With test.csv filled with the following
1;abc
2;def
3;ghi
4;jkl
5;mno
6;pqr

