From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Tables: Exclude headings in Row Number? Date: Sun, 22 Sep 2019 22:24:58 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007c973505932ff401" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36884) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCExY-0006TX-KE for emacs-orgmode@gnu.org; Sun, 22 Sep 2019 23:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCExX-0001q6-2P for emacs-orgmode@gnu.org; Sun, 22 Sep 2019 23:24:20 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:47031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCExW-0001q0-Tt for emacs-orgmode@gnu.org; Sun, 22 Sep 2019 23:24:19 -0400 Received: by mail-io1-xd34.google.com with SMTP id c6so16777167ioo.13 for ; Sun, 22 Sep 2019 20:24:18 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Neil Jerram Cc: emacs-orgmode --0000000000007c973505932ff401 Content-Type: text/plain; charset="UTF-8" I also re-read my initial question and your response *does* address my mis phrased question. To rephrase my question, I have a table with these values: | heading col 0 | heading col 1 | | ------------------ | ----------------- | | A | B | C | D I found the org-table-toggle-coordinate-overlays which displays an overlay showing the row number: https://www.evernote.com/l/AOJvD5ty6RRIBYAcSWV-047CKCHT5NIAhl8 I would like to know if there's a way to influence org-table-toggle-coordinate-overlays (e.g. some flag like "don't count rows before headings") Thanks, --Nate On Sun, Sep 22, 2019 at 10:22 PM Nathan Neff wrote: > Hi Neil, > > Unfortunately, no - This code will print the number of rows in my table - > it does > not add a column to my table, with numbering starting at the first row > under the > headline. > > I really like the example, where I can mess with the table using lisp > though - thank > you! > --Nate > > On Thu, Sep 19, 2019 at 9:13 AM Neil Jerram wrote: > >> Does this answer your question? >> >> #+NAME: tt >> | num | ID | >> |-----+----| >> | 1 | A | >> | 2 | B | >> | 3 | C | >> | 4 | | >> | 5 | E | >> >> #+BEGIN_SRC emacs-lisp :var tt=tt >> (length tt) >> #+END_SRC >> >> #+RESULTS: >> : 5 >> >> Best wishes, >> Neil >> >> >> On Wed, 18 Sep 2019 at 18:39, Nathan Neff wrote: >> >>> Hello all, >>> >>> I have a table like this: >>> >>> >>> | ID | >>> |----| >>> | 2 | >>> | 3 | >>> >>> and I want to know how many rows there are w/o the ID heading >>> and w/o the horizontal separator. I found the >>> org-table-toggle-coordinate-overlays >>> which displays an overlay showing the row number: >>> >>> https://www.evernote.com/l/AOJvD5ty6RRIBYAcSWV-047CKCHT5NIAhl8 >>> >>> However, the heading is included in the row number (which makes sense). >>> >>> Is there a way to ignore lines above a heading (or mark a heading in >>> some way? >>> >>> I found a way to add a seq. number by using Calc [1] but I was wondering >>> if >>> there's a way to tell the org-table-toggle-coordinate-overlays not to >>> count the >>> heading. >>> >>> Thanks, >>> --Nate >>> >>> [1] >>> >>> >>> | num | ID | >>> |-----+----| >>> | 1 | A | >>> | 2 | B | >>> | 3 | C | >>> | 4 | | >>> | 5 | E | >>> #+TBLFM: $1=vlen(@I..0) >>> >>> >>> https://stackoverflow.com/questions/9267050/how-to-achieve-a-row-index-column-in-emacs-org-mode-using-a-calc-column-rule >>> >>> >>> --0000000000007c973505932ff401 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I also re-read my initial question and yo= ur response *does* address my
mis phrased question.=C2=A0 To rephrase m= y question, I have a table
with these values:

| heading col 0 =C2=A0| heading col 1 |
| -----------------= - | ----------------- |
| A =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 | B
| C =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| D

I found= the org-table-toggle-coordinate-overlays
which displays an overl= ay showing the row number:


I would like to know if there's a way to influence or= g-table-toggle-coordinate-overlays
(e.g. some flag like "don= 't count rows before headings")

Thanks,
--Nate




=


On Sun, Sep 22, 2019 at 10:22 PM Nathan Neff <= ;nathan.neff@gmail.com> wro= te:
Hi Neil,

= Unfortunately, no - This code will print the number of rows in my table - i= t does
not add a column to my table, with numbering starting at t= he first row under the
headline.

I reall= y like the example, where I can mess with the table using lisp though - tha= nk
you!
--Nate

On Thu, Sep 19, 2019 at 9:13 AM Nei= l Jerram <neil= jerram@gmail.com> wrote:
= Does this answer your question?

#+NAME: tt
| num | ID= |
|-----+----|
| =C2=A0 1 | A =C2=A0|
| =C2=A0 2 | B =C2=A0|
|= =C2=A0 3 | C =C2=A0|
| =C2=A0 4 | =C2=A0 =C2=A0|
| =C2=A0 5 | E =C2= =A0|

#+BEGIN_SRC emacs-lisp :var tt=3Dtt
(length tt)
#+END_SRC=

#+RESULTS:
: 5

Best wishes,
=C2=A0 =C2=A0 Neil


On Wed, 18 Sep 2019 at 18:39, Nat= han Neff <nat= han.neff@gmail.com> wrote:
Hello= all,

I have a table like this:

=

| ID |
|----|
| =C2=A02 |
| =C2=A03 |

and I want to know how man= y rows there are w/o the ID heading
and w/o the horizontal separa= tor.=C2=A0 I found the org-table-toggle-coordinate-overlays
which= displays an overlay showing the row number:


However, the heading is included in the r= ow number (which makes sense).

Is there a way to i= gnore lines above a heading (or mark a heading in some way?

<= /div>
I found a way to add a seq. number by using Calc [1] but I was wo= ndering if
there's a way to tell the org-table-toggle-coordin= ate-overlays not to count the
heading.

T= hanks,
--Nate

[1]


| num | ID |
|-----+----|
| =C2= =A0 1 | A =C2=A0|
| =C2=A0 2 | B =C2=A0|
| =C2=A0 3 | C= =C2=A0|
| =C2=A0 4 | =C2=A0 =C2=A0|
| =C2=A0 5 | E =C2= =A0|
#+TBLFM: $1=3Dvlen(@I..0)



--0000000000007c973505932ff401--