L
L
leggiermente2016-02-18 17:43:06
Python
leggiermente, 2016-02-18 17:43:06

How to make complex tables from plain text in LaTeX?

Please tell me what is more convenient to write code to generate LaTeX tables from plain text.
The plain text structure is as follows:
| name1 | A1 / AA1 | B1/BB1 | C1/CC1 | D1 / DD1 | ... |
| name2 | A2 / AA2 | B2/BB2 | C2/CC2 | D2 / DD2 | ... |
...
Where A1 and AA1 are the numerical errors above and below for a certain value.
It is necessary to create the following table in LaTeX (with column permutation: ABCD... -> ACBD...):

$name1$  &   $^{+A1}_{-AA1}$  &  $^{+C1}_{-CC1}$ &   $^{+B1}_{-BB1}$  &  $^{+D1}_{-DD1}$ & ... \\ 
$name2$  &   $\pm A2$         &  $^{+C2}_{-CC2}$ &   $^{+B2}_{-BB2}$  &  $^{+D2}_{-DD2}$ & ... \\
...

\pm A2 - if the errors are symmetrical, taking into account rounding to the specified digit behind a comma.
Now I did it in LibreOffice Calc with a lot of conditional formatting. But this is very, very, inconvenient, since the source tables have 12 columns and several hundred rows.
What are the best tools to do this? In the tags, I marked the hypothetical options. And where is the best place to start?
PS The first column of the tables - name - unfortunately contains both spaces and numbers, which is what my regular expressions stumble on.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question