From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gMhxE0+g72JzcQAAbAwnHQ (envelope-from ) for ; Sun, 07 Aug 2022 13:21:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AAWcE0+g72JCOwEA9RJhRA (envelope-from ) for ; Sun, 07 Aug 2022 13:21:51 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F3269457B8 for ; Sun, 7 Aug 2022 13:21:50 +0200 (CEST) Received: from localhost ([::1]:41396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKeLu-0002FF-82 for larch@yhetil.org; Sun, 07 Aug 2022 07:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKeLU-0002F0-DU for emacs-orgmode@gnu.org; Sun, 07 Aug 2022 07:21:24 -0400 Received: from mailer-211-152.hitrost.net ([91.185.211.152]:64439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKeLS-0003QW-0y for emacs-orgmode@gnu.org; Sun, 07 Aug 2022 07:21:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:To:From:References:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tyWG8DCrHKEZ/zdS9RFsU4JXYf66+LpB8rHsi9oLwjY=; b=c5AhVjbddD0Zl/AyUVhA6fss3x 0OGGUDBKgbMwMYg4utsg3RNhmJNLNcBSIJEU6nHlJxNBszUHnj+FEK7uOHSZTZmUpVjckjoo59nY1 IpchQjeq2ogi3re/v7pLT0nl/NAyOv4zMCoahPqzUpbK6pGK8DmDrh4Zu6Q85Tt9wYlDaPMn1AB2y UzQm4Zxv4FsBRpoLXgZZ758q1vHR5yfSwo+JeVu9Q1R6kB7OL5YQSAnqS0p+bqM6ZZtSno+sYBa6I hvmEOQha1NeMX3DGqY/++6WYqBhiNYkEqdJN1tUB2KP2o2o5ICFHztP0dDP5ZgNDxkuwo9/mM2iG3 GcgKYEHQ==; Received: from [193.77.114.89] (helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1oKeLM-00CZAO-2A; Sun, 07 Aug 2022 13:21:16 +0200 References: <87bksxz6nu.fsf@mat.ucm.es> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: emacs-orgmode@gnu.org Subject: Re: how obtain automatic row numbers in a table starting after the second hline? In-reply-to: <87bksxz6nu.fsf@mat.ucm.es> Date: Sun, 07 Aug 2022 13:21:13 +0200 Message-ID: <87y1w08fkm.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [193.77.114.89] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.152; envelope-from=mail@christianmoe.com; helo=mailer-211-152.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659871311; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tyWG8DCrHKEZ/zdS9RFsU4JXYf66+LpB8rHsi9oLwjY=; b=s94Q5VIM3bejl7yEaqeTUpsYQoYIDySYUVmYu9hQNTcwfKBwvEBKTGCtP4r5DZZAYh12qW jcPxPRWW9lAjwZ8dIEiT/LR61Eu6aQdGppOBi/gelwpV99vwNlxzledm7jwJAuOsCzfiFh OoOPN6yR4GIRwtD2n479Y3x7q7kU/++LSXylU3Ww/+FAK8Nj7HtEvfjTZd5kTJPRsJlJEN 2HsBs4Wuoq7ArZqsxMO+Fdv+ymqsPTpIuLR/X7pTQPoQRs6SIgkaMT6PDQwrZLw36NjhOw UjjBo3XZUH92l+5UnOQVeX2vp2efDtRGAielOEkf/h7cxmRT1ygAQlVhbpqlVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659871311; a=rsa-sha256; cv=none; b=FeMHHXHcfv2zEUyxC5f7aATDlm8uQ5Y/Rtz6jg5g/VdEgCchDHcqT1Dj9D1MHMWdyxdEZB HFaJoeLcbIvQ9vxQnOz4zkPffZe2BknJX2+pan7jQ5QIp1Lfj06HOrlxqvea5EuEsH2Yjr kU+3V0bo+YMVROTPLpdlgQgObWm6N+idSSJGnd6GHajds1PnO5P4xwrYzdtxN5YT9ELJAR oY51AkcMNXzgHSHGuDamxI3wHj6rOfZ2GwNJsOYa3uJiwEPh4knW/hCRN8p2QAAZphT+j1 OK/j3PfIpfI7Rumsg6Ar527P3ASrJJY1P7b1GqkzAxOm44cmLBV6dE3ZYy36nw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=c5AhVjbd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.70 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=c5AhVjbd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: F3269457B8 X-Spam-Score: -1.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: L5n5caRri3la Hi, Uwe, Three ideas: 1. Since your solution depends on the row number (@#) in any case, your use case does not actually depend on hline-relative references, does it? Then you can also assign to absolute row numbers, either by - assigning to the range rather than to the colum, which is not possible with hline relative references (the obvious @II$1..@>$1=@#-1+572 is not allowed), but with an absolute start reference it works: | Nr | |-----| | | |-----| | 574 | | 575 | | 576 | | 577 | #+TBLFM: @3$1..@>$1=@#-1+572 - or assigning to the row first, then assigning the content between the hlines to that cell (perhaps a fragile solution). | Nr | |-----| | | |-----| | 574 | | 575 | | 576 | | 577 | #+TBLFM: $1=@#-1+572::@2$1=string("") 2. Use a conditional to avoid changing the cell between the hlines, e.g.: | Nr | |-----| | foo | |-----| | 574 | | 575 | | 576 | | 577 | #+TBLFM: $1=if(@# < 3, @0$1, @#+571) Here, I use @0$1 to replace that cell with itself. If the cell is empty, this evaluates as 0, so if you want an empty string, use string("") instead of @0$1. 3. Add a first column with special marking characters (see Org manual: Spreadsheet: Advanced features), leaving empty the cell between the hlines so it won't get recalculated. | | Nr | |---+-----| | | | |---+-----| | * | 574 | | * | 575 | | * | 576 | | * | 577 | #+TBLFM: $2=@#-1+572 Yours, Christian Uwe Brauer writes: > Hi > > I would like to obtain > #+begin_src > > | Nr | > |-----| > | | > |-----| > | 574 | > | 575 | > | .. | > | 680 | > #+end_src > > I tried > #+begin_src > > | Nr | > |----| > | 1 | > |----| > | 1 | > | 2 | > #+TBLFM: $1=vlen(@II$1..0);EN > #+end_src > > or > #+begin_src > > | Nr | > |-----| > | 573 | > |-----| > | 574 | > | 575 | > #+TBLFM: $1=@#-1+572 > #+end_src > > None worked, any ideas? > > thanks > > Uwe Brauer