[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] join two or more tables
From: |
Uwe Brauer |
Subject: |
Re: [O] join two or more tables |
Date: |
Sun, 18 Aug 2019 13:34:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>>> "AG" == Achim Gratz <address@hidden> writes:
> Uwe Brauer writes:
>> Thanks I knew about it, but it seems very sophisticated and column, not
>> row based.
> Well, if simple-minded suits you (i.e. the columns are known to have the
> same order):
> Tables in Org are lists with rows as their elements, and a row is either
> a symbol or a list of column elements. So just concatenating the two
> lists does (almost) the right thing. If you know the row has headers,
> you need to skip until the first real data row in the second table
> (i.e. skip the first row, the first header and then resume the concat).
> Your other option is just grabbing the text of both tables, emit it as a
> single entity (again you may want to remove the header on the second
> table) and then call org-align-table on it.
Hm, thanks but could you post an example (the one I finally used is
based on R and goes as follows
#+tblname: TC
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |
| 7 | 8 | 9 |
#+tblname: TD
| a | b | c |
|----+----+----|
| 4 | 5 | 6 |
| 10 | 11 | 12 |
#+begin_src R :colnames t :var t1=TC t2=TD
rbind(t1, t2)
#+end_src
#+RESULTS:
| a | b | c |
|----+----+----|
| 1 | 2 | 3 |
| 7 | 8 | 9 |
| 4 | 5 | 6 |
| 10 | 11 | 12 |
smime.p7s
Description: S/MIME cryptographic signature