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: Derek Feichtinger
Subject: Re: [O] org table with auto-incrementing numbers in a column
Date: Tue, 16 Feb 2016 06:22:43 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi

Kaushal Modi <kaushal.modi <at> gmail.com> writes:

> 
> Hi,
> I am trying to get auto-incrementing numbers in the first column in an org
table. The goal is to recalculate the numbers after adding/removing rows.
> 
> I checked out the org
FAQ: 
http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers
> 
> 
> But I am still not getting it to work as I need to.
> 
> Below is the minimum working example. Paste the below in an org buffer.
> 
> 
> 
> | N |   |
> |---+---|
> |   |   |
> |   |   |
> |   |   |
> |   |   |
> #+TBLFM: $1= <at> -1+1:: <at> 2$1=1
> 
> 

Try this

  | N |   |
  |---+---|
  |   |   |
  |   |   |
  |   |   |
  |   |   |
  #+TBLFM: <at>$1..<at>>$1= <at>-1 + 1:: <at>2$1=1


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.

> Now with the point anywhere in the table, when I hit "C-c *" or M-x
org-table-recalculate, I expect the first column to be auto-populated with
numbers 1,2,3,4 (or that's how I understood from the tutorial in the FAQ
link above).
> 
> But it does not work that way. Instead I need to go to each row and hit C-c *.

Placing point on the TBLFM line and doing C-c C-c should recalculate the
whole table.


Cheers,
Derek



reply via email to

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