1

I intent to copy the value of a cell and put the exact copy to the target cell and be able to update the value on referenced cell to be updated on the targeted one.

Calling remote to a cell evaluate its value and then return the result of the process which might be different then the original text.

In my case remoted cells have '.' and '/' symbols. So far I tried these:

#+NAME: t1
|   | 01.02.2003 |
| ^ |        foo |

#+NAME: t2
| #ERROR |
#+TBLFM: @1=remote(t1,@1$2)

#+NAME: t3
| (01.02.2003) |
#+TBLFM: @1=string("remote(t1,@1$2)

#+NAME: t4
| ((01.02.2003)) |
#+TBLFM: @1=string("remote(t1,$foo)

#+NAME: t5
| "01.02.2003" |

#+NAME: t6
| 01.02.2003 |
#+TBLFM: @1=string(remote(t5,@1$1)

Edit: To explain further. Basically I want to...

#+NAME: t1
| 01.02.2003 | --------> Edit this cell and expect to update the value of -->|
                                                                             |
#+NAME: t2                                                                   |
| 01.02.2003 | <--- this cell -------------------------------------------<
5
  • Just an FYI: #+TBLNAME is only available for backward compatibility - you should use #+NAME: instead.
    – NickD
    Commented Dec 4, 2019 at 19:12
  • I don't understand what you are trying to do: can you please specify the initial table and what the final table should look like? AFAICT, you are showing the results of failed experiments but you do not show what a successful experiment would produce.
    – NickD
    Commented Dec 4, 2019 at 19:14
  • For that to happen, you have to press C-c C-c on the #+TBLFM: line of table t2 - it's not going to happen automatically.
    – NickD
    Commented Dec 4, 2019 at 19:56
  • My problem starts right here if the value of t1's @1$2 cell has symbol like . or / I get #ERROR whenever I try C-c C-c Commented Dec 4, 2019 at 20:10
  • Ah, now I see - you are right in your diagnosis: "Calling remote to a cell evaluate its value and then return the result of the process which might be different then the original text." Emacs Calc is used for the evaluation and (some of) the things you mention are illegal inputs to Calc. You can enable formula debugging with C-c { and see the errors - but that does not solve the problem.
    – NickD
    Commented Dec 4, 2019 at 22:16

1 Answer 1

2

I believe the following works to literally copy a cell from one table to another. Try it and see:

#+NAME: t1
|   | 01/03.03  |
| ^ | foo       |

#+NAME: t2
| 01/03.03 |
#+TBLFM: @1$1='(identity remote(t1, @1$2))

although I'm not sure how useful it will be to you: it depends on what exactly you want to do afterwards.

EDIT: I don't know why org mode adds parentheses in the named reference case:

#+NAME: t1
|   | 01/03.03  |
| ^ | foo       |

#+NAME: t2
| (01/03.03) |
#+TBLFM: @1$1='(identity remote(t1, $foo))

When I debug the formula, the parentheses are part of the string, so I believe org mode does that, not Calc. You can get rid of them using the lisp substring function, but I don't know of a way to treat the two cases uniformly:

#+NAME: t2
| 01/03.03 |
#+TBLFM: @1$1='(identity (substring remote(t1, $foo) 1 -1))
2
  • It works flawlessly in my case if I reference the cells that way. However I get additional pair of parenthesis with `(identity remote(t1,$foo)) Commented Dec 4, 2019 at 22:50
  • Indeed - I don't know how to deal with that case.
    – NickD
    Commented Dec 5, 2019 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.