emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* insert automatically row number in tables.
@ 2016-03-07 11:24 Uwe Brauer
  2016-03-07 12:09 ` Bernhard Pröll
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2016-03-07 11:24 UTC (permalink / raw)
  To: emacs-orgmode

Hi

I would like to insert row in a table, and then hitting C-c C-c, the
leftmost column gets filled by the row number.

Such as in


| row | data |
|-----+------|
|     | 0303 |
|     | 5123 |
|     |   41 |
|     | 4234 |
#+TBLFM: magic command

C-c C-c

gives


| row | data |
|-----+------|
| 2   | 0303 |
| 3   | 5123 |
| 4   | 41   |
| 5   | 4234 |
#+TBLFM: magic command

Then
| row | data |
|-----+------|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
|     |   17 |
#+TBLFM: magic command

C-c C-c

gives

| row | data |
|-----+------|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
|   6 |   17 |
#+TBLFM: magic command


I googled around and found solutions such as:

https://stackoverflow.com/questions/9267050/how-to-achieve-a-row-index-column-in-emacs-org-mode-using-a-calc-column-rule

Or
https://lists.gnu.org/archive/html/emacs-orgmode/2008-08/msg00054.html

But none of them worked for me the way I described it.

Any comments or help?

thanks

Uwe Brauer 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: insert automatically row number in tables.
  2016-03-07 11:24 insert automatically row number in tables Uwe Brauer
@ 2016-03-07 12:09 ` Bernhard Pröll
  2016-03-07 13:04   ` Uwe Brauer
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Pröll @ 2016-03-07 12:09 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Hi,

the following formula will do this for me:

| row | data |
|-----+------|
|   2 | 0303 |
|   3 | 5123 |
|   4 |   41 |
|   5 | 4234 |
|   6 |   34 |
#+TBLFM: $1=@#

Regards,

Bernhard Pröll

On Mon, 07. Mar 11:24, Uwe Brauer wrote:
>Hi
>
>I would like to insert row in a table, and then hitting C-c C-c, the
>leftmost column gets filled by the row number.
>
>Such as in
>
>
>| row | data |
>|-----+------|
>|     | 0303 |
>|     | 5123 |
>|     |   41 |
>|     | 4234 |
>#+TBLFM: magic command
>
>C-c C-c
>
>gives
>
>
>| row | data |
>|-----+------|
>| 2   | 0303 |
>| 3   | 5123 |
>| 4   | 41   |
>| 5   | 4234 |
>#+TBLFM: magic command
>
>Then
>| row | data |
>|-----+------|
>|   2 | 0303 |
>|   3 | 5123 |
>|   4 |   41 |
>|   5 | 4234 |
>|     |   17 |
>#+TBLFM: magic command
>
>C-c C-c
>
>gives
>
>| row | data |
>|-----+------|
>|   2 | 0303 |
>|   3 | 5123 |
>|   4 |   41 |
>|   5 | 4234 |
>|   6 |   17 |
>#+TBLFM: magic command
>
>
>I googled around and found solutions such as:
>
>https://stackoverflow.com/questions/9267050/how-to-achieve-a-row-index-column-in-emacs-org-mode-using-a-calc-column-rule
>
>Or
>https://lists.gnu.org/archive/html/emacs-orgmode/2008-08/msg00054.html
>
>But none of them worked for me the way I described it.
>
>Any comments or help?
>
>thanks
>
>Uwe Brauer
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: insert automatically row number in tables.
  2016-03-07 12:09 ` Bernhard Pröll
@ 2016-03-07 13:04   ` Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2016-03-07 13:04 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

>>> "Bernhard" == Bernhard Pröll <bmutbuerger@gmail.com> writes:

   > Hi,
   > the following formula will do this for me:

   > | row | data |
   > |-----+------|
   > |   2 | 0303 |
   > |   3 | 5123 |
   > |   4 |   41 |
   > |   5 | 4234 |
   > |   6 |   34 |
   > #+TBLFM: $1=@#

   > Regards,

Yeah thanks the point is that one need to use

C-u C-u C-c C-c

Not C-c C-c


Sorry for the noise.


Uwe Brauer 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-07 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 11:24 insert automatically row number in tables Uwe Brauer
2016-03-07 12:09 ` Bernhard Pröll
2016-03-07 13:04   ` Uwe Brauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).