I would like to have a column in an org mode table that is a simple monotonically increasing value, i.e. the row number such that wnen I insert and remove random rows the index value adjusts automagically. I suspect that this should be simple but it would appear I am making it way too difficult. Mind you, I am a novice at using Emacs and org mode to build spreadsheets. So a simple example spreadsheet where there are two columns, one the row index value and the other some fixed value, would be a perfect answer.
The easiest way to create a table is to directly type the "|" character at the beginning of a line, or after any amount of white space. This will put you in the first field of an atomic table. Once you've finished editing this cell, you can jump to the next one by pressing TAB .
To save the document, either press the save icon, or press C-x C-s, call it 1.org. Emacs does not actually understand you are editing an Org document, yet. To enable Org mode on your current document, type M-x org-mode which will enable the Org mode on the current document. Those are minuses, not underscores.
Org Mode (also: org-mode; /ˈɔːrɡ moʊd/) is a document editing, formatting, and organizing mode, designed for notes, planning, and authoring within the free software text editor Emacs.
This example uses @#
to get the row number. Similarly, $#
returns the column number.
| row | data |
|-----+------|
| 2 | 0303 |
| 3 | 5123 |
| 4 | 41 |
| 5 | 4234 |
#+TBLFM: $1=@#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With