emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] org table with auto-incrementing numbers in a column


From: Kaushal Modi
Subject: Re: [O] org table with auto-incrementing numbers in a column
Date: Tue, 16 Feb 2016 11:28:08 -0500

Thanks everyone for replying!

I made one mistake before posting that question: I should have looked up C-h f org-table-recalculate. And now I did :)
I should have done "C-u C-c * " when the point was in the table (I was doing just C-c *, which evaluates only the current row).

>> Derek
> | N |   |
> |---+---|
> |   |   |
> |   |   |
> |   |   |
> |   |   |
> #+TBLFM: @3$1..@>address@hidden + 1::@2$1=1

Thanks Derek! That worked! btw I was a bit perplexed looking at your solution because it showed "<at>" instead of "@" :)

> One problem is that $1 also includes the first row with the "N" heading.
> that is why in your example the second and third lines both will at first
> contain 1 (at least with my org version 8.3.3), and in the second iteration
> only show the correct series.

I just learned that doing "C-u C-u C-c C-c" or "C-u C-u C-c *" with the point anywhere on the table, keeps re-evaluating the whole table till the values are stable. (NOTE that these do not work when point is on the #+TBLFM line; the point HAS to be inside the table).

So the original example also works just fine if I use C-u C-u C-c C-c

| N |   |
|---+---|
|   |   |
|   |   |
|   |   |
|   |   |
#+TBLFM: address@hidden::@2$1=1

>> Dieter

Thanks! Your solution works too, with C-u C-c C-c anywhere in the table.

| N |
|---|
|   |
|   |
|   |
|   |
#+TBLFM: address@hidden

That said, can someone please update that FAQ at http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers
It would be great to mention C-u C-c C-c and C-u C-u C-c C-c in that solution too.

reply via email to

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