i have two sperate tables with the same number of rows and labels
as follows:
one:
a 12
b 32
c 18
two:
a 45
b 98
c 300
how can i combine those two tables into one?
as follows:
a 12 45
b 32 98
c 18 300
thank
Elisheva
tables
i have two sperate tables with the same number of rows and labels
as follows:
one:
a 12
b 32
c 18
two:
a 45
b 98
c 300
how can i combine those two tables into one?
as follows:
a 12 45
b 32 98
c 18 300
thank
Elisheva
Best Answer
The
\pgfplotstablecreatecol
command from thepgfplotstable
package can be used here to add additional columns to a table when it is created:As I mentioned in the code, the
filecontents*
section is just for the example; you can have your tables in external separate files, for example, or you can have them in your actual.tex
file.Here's a more real example, explaining step by step the procedure.
Create a file
table1.dat
like this one:Create a file
table2.dat
like this one:Notice that entries with more than one word are grouped using braces. Also I provided some headings for the first row of the merged table.
Save these files in your current working directory (the same cotaining your
.tex
file).Your
.tex
file should have the following aspect:Processing the above document yields: