From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kPbGFg7KdV9/EgAA0tVLHw (envelope-from ) for ; Thu, 01 Oct 2020 12:22:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2KCXEg7KdV+VEAAAB5/wlQ (envelope-from ) for ; Thu, 01 Oct 2020 12:22:38 +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 3F0F79404CF for ; Thu, 1 Oct 2020 12:22:32 +0000 (UTC) Received: from localhost ([::1]:44008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNxbM-0004FE-Uf for larch@yhetil.org; Thu, 01 Oct 2020 08:22:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNxag-0004ET-G9 for emacs-orgmode@gnu.org; Thu, 01 Oct 2020 08:21:43 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:36373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNxac-0007ip-M3 for emacs-orgmode@gnu.org; Thu, 01 Oct 2020 08:21:42 -0400 Received: by mail-wm1-x335.google.com with SMTP id e2so2838908wme.1 for ; Thu, 01 Oct 2020 05:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xieJAGVJMwdbILtCR+gYmm5m1MdQc5ch1XZCHf0BOgc=; b=Nx9KdVrslqxDRn9flXTLIh4aB4/w4JvoBpn/KAjLMytjltE8xH+Ng+7qq4pOxkY9r5 5e2m7iUhQitQbeGeS7cgvgZis9KcLWc7VR6BF0t/9nd1S2www6hT+4C6NrHuX+LVx/i3 3XrHFW6ay6AOcjAEDSKTh/v28UaRksAhPSmy99WojQbUC/deYWiQnOxrTQohBnMHo+34 6IDep99vDVNb7FxYc/v5vPbB/joZv310iQUbOHCl2FfRFeuzoMxRPfVwpUUXbOLtUzZ6 WkJg2GCeRjndEMCsXzJS4MOAj1CtfykEFMKOpLo/Ig7IqiOfoa1FpXLgk5e/itDb8l4v ZlgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xieJAGVJMwdbILtCR+gYmm5m1MdQc5ch1XZCHf0BOgc=; b=DPFLq1EjcBva5E1fsPOUOxeSepISn4YwlYQp4+5KOISOBfd2zXCb7kigBWZ6pvoDNs W/BeCQ37319olFHE24suSQOOHo4ObWHkRVIirF/wJJo8lJGV+pWCjwlVfOLMY+Mm/Ja5 m27uKG0kpI5laMp90/6ijAQ7jc3dujRjiYVjhgD8kJwZSpp31hD6n3BS9FeOBF4kpuBb u5Fs+mAK9LtxFipmrS9CFs4/WihCmQl3Q4xzVmWhIga1TSMkR8nVEfLLUL/lM1c0P8FI 6CZX5I8FCyDfqX/Dk+9XzAomKv2Wv9BHhr5TyFjsjBph0q21pjNzPz53fR8d1p6eEs3B x/rg== X-Gm-Message-State: AOAM533d6iray7IoVmWnJ/pylZ1P6nnAAU8mrBJDQ4FZUHr2qXMS8+0p ZxAajHeWufZNvDvAjcGhoZwk19GnmVhe+1C1HHU= X-Google-Smtp-Source: ABdhPJyMtRaY5gSPKw5KsPtGGcV5d+TM8J9eZ0ulzxkUJZwVQtlZfeccYpefMT7W0L72AMYHYGx+EGpja7s+rAmNip0= X-Received: by 2002:a05:600c:20c8:: with SMTP id y8mr7983766wmm.108.1601554895881; Thu, 01 Oct 2020 05:21:35 -0700 (PDT) MIME-Version: 1.0 References: <65644810-71B5-412C-9E13-ADC15CA80CF6@axelkielhorn.de> In-Reply-To: <65644810-71B5-412C-9E13-ADC15CA80CF6@axelkielhorn.de> From: John Kitchin Date: Thu, 1 Oct 2020 08:21:20 -0400 Message-ID: Subject: Re: Two tables with same data but different sorting To: Axel Kielhorn Content-Type: multipart/alternative; boundary="000000000000a8481a05b09b0ec8" Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=johnrkitchin@gmail.com; helo=mail-wm1-x335.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Org-Mode Mailing List Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=Nx9KdVrs; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=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.11 X-TUID: mwyf5vBlUoNE --000000000000a8481a05b09b0ec8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You could do something like this: * Table 1 #+name: table1 | Manufacturer | Name | Price | |-----------------+-------------+-------| | ACME | super cheep | 25 $ | | Roadrunner Inc. | Kaboom | 27 $ | | ACME | cheep | 30 $ | #+RESULTS: resorted | Manufacturer | Name | Price | |-----------------+-------------+-------| | ACME | super cheep | 25 $ | | 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< (first row1) (first row2)))) #+END_SRC John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Thu, Oct 1, 2020 at 4:57 AM Axel Kielhorn wrote: > Hello! > > I have a table that I want to show with two different sorting orders but = I > don=E2=80=99t want to maintain the data twice. > > > * Table 1 > > | Manufacturer | Name | Price | > |-----------------+-------------+-------| > | ACME | super cheep | 25 $ | > | Roadrunner Inc. | Kaboom | 27 $ | > | ACME | cheep | 30 $ | > > * Table 2 > > | Manufacturer | Name | Price | > |-----------------+-------------+-------| > | ACME | cheep | 30 $ | > | ACME | super cheep | 25 $ | > | Roadrunner Inc. | Kaboom | 27 $ | > > Is there a way to do this in org? > Right now I copy the table and apply an =3DC-c ^ a=3D on the first column= . > > Greetings > Axel > --000000000000a8481a05b09b0ec8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You could do something like this:


*= Table 1

#+name: table1
| Manufacturer =C2=A0 =C2=A0| Name =C2=A0= =C2=A0 =C2=A0 =C2=A0| Price |
|-----------------+-------------+-------|=
| ACME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| super cheep | 25 $ = =C2=A0|
| Roadrunner Inc. | Kaboom =C2=A0 =C2=A0 =C2=A0| 27 $ =C2=A0|| ACME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| cheep =C2=A0 =C2=A0 =C2= =A0 | 30 $ =C2=A0|

#+RESULTS: resorted
| Manufacturer =C2=A0 =C2= =A0| Name =C2=A0 =C2=A0 =C2=A0 =C2=A0| Price |
|-----------------+------= -------+-------|
| ACME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| super= cheep | 25 $ =C2=A0|
| ACME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = cheep =C2=A0 =C2=A0 =C2=A0 | 30 $ =C2=A0|
| Roadrunner Inc. | Kaboom =C2= =A0 =C2=A0 =C2=A0| 27 $ =C2=A0|

** Code for resorting

#+name:= resorted
#+BEGIN_SRC emacs-lisp :var data=3Dtable1 :colnames t
(sort= data (lambda (row1 row2) (string< (first row1) (first row2))))
#+END= _SRC

John

---= --------------------------------
Professor John Kitchin=C2=A0
Doherty= Hall A207F
Department of Chemical Engineering
Carnegie Mellon Univer= sity
Pittsburgh, PA 15213
412-268-7803

On Thu, Oct 1, 2020 at 4:57 AM Axel Kielhorn <org-mode@axelkielhorn.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Hello!

I have a table that I want to show with two different sorting orders but I = don=E2=80=99t want to maintain the data twice.


* Table 1

| Manufacturer=C2=A0 =C2=A0 | Name=C2=A0 =C2=A0 =C2=A0 =C2=A0 | Price |
|-----------------+-------------+-------|
| ACME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | super cheep | 25 $=C2=A0 = |
| Roadrunner Inc. | Kaboom=C2=A0 =C2=A0 =C2=A0 | 27 $=C2=A0 |
| ACME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | cheep=C2=A0 =C2=A0 =C2=A0= =C2=A0| 30 $=C2=A0 |

*=C2=A0 Table 2

| Manufacturer=C2=A0 =C2=A0 | Name=C2=A0 =C2=A0 =C2=A0 =C2=A0 | Price |
|-----------------+-------------+-------|
| ACME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | cheep=C2=A0 =C2=A0 =C2=A0= =C2=A0| 30 $=C2=A0 |
| ACME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | super cheep | 25 $=C2=A0 = |
| Roadrunner Inc. | Kaboom=C2=A0 =C2=A0 =C2=A0 | 27 $=C2=A0 |

Is there a way to do this in org?
Right now I copy the table and apply an =3DC-c ^ a=3D on the first column.<= br>
Greetings
Axel
--000000000000a8481a05b09b0ec8--