emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Can't import a remote reference to a whole column in o


From: Michael Brand
Subject: Re: [Orgmode] Re: Can't import a remote reference to a whole column in orgtbl
Date: Sun, 04 Apr 2010 21:02:40 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Carsten Dominik wrote:
but being able to import whole rows/columns
would be incredibly useful.

There is actually now a way to do tis - even though it is inefficient. To copy column 2 from table FOO into column 3 of the current table, use

 #+TBLFM: $3=remote(FOO,@@#$2)

This is now possible due to a patch by Michael Brand:
    http://thread.gmane.org/gmane.emacs.orgmode/22930

It works well, but it is inefficient because this formula will
parse the FOO table again for each field to be copied.

Very nice use case for address@hidden'. How about a doc update somehow like 
this?

=============================================================================
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -2061,10 +2061,15 @@ see the @samp{E} mode switch below).  If
 For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
 get the row or column number of the field where the formula result goes.
 The traditional Lisp formula equivalents are @code{org-table-current-dline}
-and @code{org-table-current-column}.  Example:
+and @code{org-table-current-column}.  Examples:

 @example
-if(@@# % 2, $#, string(""))      @r{column number on odd lines only}
+if(@@# % 2, $#, string(""))   @r{column number on odd lines only}
+$3 = remote(FOO, @@@@#$2)      @r{copy column 2 from table FOO into}
+                             @r{column 3 of the current address@hidden
+tables must have the same count of rows.  Inefficient for a large count N of
+rows with a time complexity of O(N^2) because all rows of the FOO table will
+be parsed again for each field to be copied.}}
 @end example

 @subsubheading Named references
=============================================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]