From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MDsgMCLVel9tBAAA0tVLHw (envelope-from ) for ; Mon, 05 Oct 2020 08:11:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cJmJKyLVel+EDAAAbx9fmQ (envelope-from ) for ; Mon, 05 Oct 2020 08:11:14 +0000 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 44A049400D3 for ; Mon, 5 Oct 2020 08:11:14 +0000 (UTC) Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPLaT-0000HK-6N for larch@yhetil.org; Mon, 05 Oct 2020 04:11:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPLXd-0006Zf-HH for emacs-orgmode@gnu.org; Mon, 05 Oct 2020 04:08:17 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.160]:14391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPLXa-0005A6-Ve for emacs-orgmode@gnu.org; Mon, 05 Oct 2020 04:08:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1601885290; s=strato-dkim-0002; d=axelkielhorn.de; h=Message-Id:In-Reply-To:To:References:Date:Subject:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Mq9+xYXfDt3CAEU+L0N1RYgJTLg2KACgEsxgmIavpDU=; b=rmt2k8gkcBYE9PPat37RS1qQLX9wwrEoOXw3l0HBIlB/o+FWZpKM2/mJY9F130E/hi FC+Msy8EcxA5rgbjulJYcQG/gPxDK7mDJGmRXDyPpeNxBzRI1lcnmU5/bqdivPWE7WQY 6vkeRi/cxDhw30Xyu1gKkheesanP7a1Kl1GrcvzAXX9mzA0CyaEHi1tLzWNSJJGQ5ZDk mmtTFgr+fqC96ZbfotfbIehYD7U89idPqRriGrVbiDr2ZCmq3cUxo69FDCygcjzQpNw7 R0BU1TTHHD+1aI7Y8GKRWhHm/AMTuUKn5iPnktpyS54JwVCYBhCiT6ZWRcfDYo9b7Izw 0HmQ== X-RZG-AUTH: ":OGkcVUGwfvMLvkVusQ1g9gJQt7WL23nhrqI2F4F9RuxzbAQePvTSV0cr4JoWPbaGO12LoL58ZxsUEd7NWOcSp+vkv33DWnCEwv8/TjEe9A==" X-RZG-CLASS-ID: mo00 Received: from [IPv6:2003:cc:ff06:1600:ad12:a090:c369:1319] by smtp.strato.de (RZmta 47.2.1 AUTH) with ESMTPSA id Y024eew9588A5qi (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate) for ; Mon, 5 Oct 2020 10:08:10 +0200 (CEST) From: Axel Kielhorn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: Two tables with same data but different sorting Date: Mon, 5 Oct 2020 10:08:08 +0200 References: <65644810-71B5-412C-9E13-ADC15CA80CF6@axelkielhorn.de> <3CB77DC4-121C-43D9-A814-16FB1DE307B1@axelkielhorn.de> <58A08721-0871-49F3-B190-F0B1F533C6B7@axelkielhorn.de> To: Org-Mode Mailing List In-Reply-To: Message-Id: <09250BFA-F311-4F09-A62A-31D9EED76245@axelkielhorn.de> X-Mailer: Apple Mail (2.3445.9.7) Received-SPF: none client-ip=81.169.146.160; envelope-from=org-mode@axelkielhorn.de; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 04:08:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=axelkielhorn.de header.s=strato-dkim-0002 header.b=rmt2k8gk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: uCMPRcdEPA2h > Am 02.10.2020 um 11:36 schrieb Robert Pluim : >=20 >>>>>> On Fri, 2 Oct 2020 08:25:03 +0200, Axel Kielhorn = said: >=20 >>> Am 01.10.2020 um 17:47 schrieb John Kitchin = : >>>=20 >>> Glad it was helpful. You might also try (seventh row1) or (nth 6 = row1). I think it is the same thing, but more obvious to read! >=20 > Axel> I agree that =E2=80=9Efirst second =E2=80=A6=E2=80=9C would = be easier for an english speaker. > Axel> Having the ordinal number 1 based but the nth number 0 based = is irritating (and sadly there is no =E2=80=9Elast=E2=80=9C or = =E2=80=9Epenultimate=E2=80=9C). >=20 > ? C-h f last >=20 > last is a compiled Lisp function in `subr.el'. >=20 > (last LIST &optional N) >=20 > Probably introduced at or before Emacs version 1.1. > This function does not change global state, including the match = data. >=20 > Return the last link of LIST. Its car is the last element. > If LIST is nil, return nil. > If N is non-nil, return the Nth-to-last link of LIST. > If N is bigger than the length of LIST, return LIST. As i understand it, this should work: * Table #+name: table1 | Manufacturer | Name | Price | |-----------------+-------------+-------| | ACME | super cheep | 127 $ | | Roadrunner Inc. | Kaboom | 27 $ | | ACME | cheep | 30 $ | #+RESULTS: resorted | Manufacturer | Name | Price | |-----------------+-------------+-------| | ACME | super cheep | 127 $ | | ACME | cheep | 30 $ | | Roadrunner Inc. | Kaboom | 27 $ | ** Code for resorting #+name: resorted #+BEGIN_SRC emacs-lisp :var data=3Dtable1 :colnames t (sort data (lambda (row1 row2) (string< (last row1) (last row2)))) #+END_SRC But I get: Wrong type argument: stringp, ("30 $=E2=80=9C) Greeting Axel=