Gary <emacs-orgm...@garydjones.name> writes:

> Is there any way to sort the columns of a table, such that for example
>
> | Col 3 | Col 1 | Col 2 |
>
> can be converted to
>
> | Col 1 | Col 2 | Col 3 |
> |-------+-------+-------|
> | ...   | ...   | ...   |
>

I'd do this using an external language that has a matrix/table data type
with column indexing.

#+tblname: unsorted
| Col3 | Col1 | Col2 |
|------+------+------|
| c    | a    |    b |

#+source: sorted
#+begin_src R :var tab=unsorted :colnames yes
tab[,order(colnames(tab))]
#+end_src

#+results: sorted
| Col1 | Col2 | Col3 |
|------+------+------|
| a    | b    | c    |

Dan

> ?
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to