Bernt Hansen <[EMAIL PROTECTED]> writes:

> "Daniel J. Sinder" <[EMAIL PROTECTED]> writes:
>
>> 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(@[EMAIL PROTECTED],$2)
>
> This assumes the data in Data Column 1 ($2) is unique


This works better.  It doesn't assume anything about the data and you
can add as many horizontal lines as you want in the table.  This also
removes the requirement for the trailing horizontal line from the
previous solution.

  | Row | Data Column 1 | Data Column 2 |
  |-----+---------------+---------------|
  |   1 | x1            |               |
  |   2 | some data     | more data     |
  |-----+---------------+---------------|
  |   3 |               |               |
  |   4 |               |               |
  |   5 |               |               |
  |   6 |               |               |
#+TBLFM: $1=vlen(@I$2..0)/2;EN

-Bernt


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to