[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Including row numbers in a table
From: |
Bernt Hansen |
Subject: |
[Orgmode] Re: Including row numbers in a table |
Date: |
Sat, 09 Aug 2008 01:59:37 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
"Daniel J. Sinder" <address@hidden> writes:
> I haven't used table formulas that much and I can't figure this one
> out. I'd like to include row numbers in the table itself. Something
> like this:
>
> | Row | Data Column 1 | Data Column 2 |
> |-----+----------------+---------------------|
> | 1 | some data | more data |
> | 2 | some more data | even more data |
> |-----+----------------+---------------------|
> | 3 | still more | yup, you guessed it |
> | 4 | and more | that's all |
>
>
> I'd like to use a formula for the first column so that if I move rows
> around using org commands, the row numbers can be easily
> re-calculated. Note that I'd like numbering to continue sequentially
> across horizontal lines.
>
> I've tried column formulas like @-1+1, but the horizontal lines get in
> the way. And if every row needs it's own formula, it's hardly better
> than just filling in the numbers.
>
> Can anyone suggest how to do this is a reasonably automated fashion?
>
| Row | Data Column 1 | Data Column 2 |
|-----+----------------+---------------------|
| 1 | some data | more data |
| 2 | some more data | even more data |
|-----+----------------+---------------------|
| 3 | and more | that's all |
| 4 | still more | yup, you guessed it |
|-----+----------------+---------------------|
#+TBLFM: $1=find(@address@hidden,$2)
This assumes the data in Data Column 1 ($2) is unique
-Bernt