From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leslie Watter Subject: Re: Best way to template a big table Date: Thu, 12 Dec 2019 22:01:55 -0300 Message-ID: References: <414AEABC-42BD-4847-A03F-29E7EADBDD2D@ucsd.edu> Reply-To: leslie@watter.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002392b405998b6913" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58561) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifZLN-0003BF-MY for emacs-orgmode@gnu.org; Thu, 12 Dec 2019 20:02:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifZLM-0001U2-9F for emacs-orgmode@gnu.org; Thu, 12 Dec 2019 20:02:09 -0500 Received: from mail-il1-f177.google.com ([209.85.166.177]:45901) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifZLM-0001S8-2X for emacs-orgmode@gnu.org; Thu, 12 Dec 2019 20:02:08 -0500 Received: by mail-il1-f177.google.com with SMTP id p8so625357iln.12 for ; Thu, 12 Dec 2019 17:02:07 -0800 (PST) In-Reply-To: <414AEABC-42BD-4847-A03F-29E7EADBDD2D@ucsd.edu> 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: "Berry, Charles" Cc: Simon Butler , emacs-orgmode Mailinglist , Lawrence Bottorff --0000000000002392b405998b6913 Content-Type: text/plain; charset="UTF-8" Hi all, As I've understood you want to setup the structure of the table and have some prompts to add rows to the table. Using org-mode I have a capture skeleton here that uses ------- org capture template #+begin_src elisp ;; ("Lu" "Fuel" table-line (file+olp "~/org/TODO.org" "Car" "Fuel Control") "|%<%Y-%m-%d> | %^{Price} | %^{ototanterior} | %^{ototatual} | | %^{liters} | %^{RSxl} | %^{Average} | %^{GasType}| ") #+end_src And at TODO.org I have the following structure #+begin_example * Car ** Fuel Control | Date | Price | otot anterior | otot atual | partial | Liters | R$/l | Average | Fuel type | |------------+---------+---------------+------------+--------------+--------+-------+-----------+-----------| (...) #+end_example I've just written the structure of the table and every time I have a new entry I use capture to fill in the table. You'll get a prompt with the name of the strings asked. Hope it helps. Cheers, LEslie On Thu, Dec 12, 2019 at 3:33 PM Berry, Charles wrote: > > > > On Dec 12, 2019, at 8:03 AM, Lawrence Bottorff > wrote: > > > > I just figured out that this > > > > #+BEGIN_SRC emacs-lisp :results table > > '((H1 H2 H3) (text11 text12 text13) (text21 text22 text23) (... ... ...) > (textN1 textN2 textN3)) > > #+END_SRC > > > > #+RESULTS: > > | H1 | H2 | H3 | > > | text11 | text12 | text13 | > > | text21 | text22 | text23 | > > | ... | ... | ... | > > | textN1 | textN2 | textN3 | > > > > is probably a better way all around, i.e., "best practice." If any one > knows how to get the horizontal lines added in. . . . > > > Add an `hline' in the right place. Like this: > > #+BEGIN_SRC emacs-lisp :results table > '((H1 H2 H3) hline (text11 text12 text13) (text21 text22 text23) (... ... > ...) (textN1 textN2 textN3)) > #+END_SRC > > HTH, > > Chuck > > -- Leslie H. Watter --0000000000002392b405998b6913 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

As I've understood you want= to setup the structure of the table and have some prompts to add rows to t= he table.

Using org-mode I have a capture skeleton= here that uses=C2=A0

------- org capture template
#+begin_src elisp
;;=C2=A0
=C2=A0 ("Lu&qu= ot; "Fuel" table-line
=C2=A0(file+olp "~/org/TODO.org&q= uot; "Car" "Fuel Control")
=C2=A0"|%<%Y-%m= -%d> | %^{Price} | %^{ototanterior} | %^{ototatual} | =C2=A0| %^{liters}= | =C2=A0%^{RSxl} | %^{Average} | %^{GasType}|
")
#+e= nd_src

And at TODO.org I have the following struct= ure

#+begin_example
=C2=A0* Car
** Fuel Control

| =C2=A0 =C2=A0 =C2=A0 Date | =C2=A0 Price = | otot anterior | otot atual | partial | Liters | =C2=A0R$/l |=C2=A0 =C2=A0= Average | Fuel type=C2=A0 |
|------------+---------+---------------+---= ---------+--------------+--------+-------+-----------+-----------|
(...)

#+end_example

=
I've just written the structure of the table and every time I have= a new entry I use capture to fill in the table. You'll get a prompt wi= th the name of the strings asked.

Hope it helps.= =C2=A0

Cheers,

LEslie=


On Thu, Dec 12, 2019 at 3:33 PM Berry, Charles &= lt;ccberry@health.ucsd.edu&g= t; wrote:


> On Dec 12, 2019, at 8:03 AM, Lawrence Bottorff <borgauf@gmail.com> wrote:
>
> I just figured out that this
>
> #+BEGIN_SRC emacs-lisp :results table
> '((H1 H2 H3) (text11 text12 text13) (text21 text22 text23) (... ..= . ...) (textN1 textN2 textN3))
> #+END_SRC
>
> #+RESULTS:
> | H1=C2=A0 =C2=A0 =C2=A0| H2=C2=A0 =C2=A0 =C2=A0| H3=C2=A0 =C2=A0 =C2= =A0|
> | text11 | text12 | text13 |
> | text21 | text22 | text23 |
> | ...=C2=A0 =C2=A0 | ...=C2=A0 =C2=A0 | ...=C2=A0 =C2=A0 |
> | textN1 | textN2 | textN3 |
>
> is probably a better way all around, i.e., "best practice." = If any one knows how to get the horizontal lines added in. . . .


Add an `hline' in the right place. Like this:

#+BEGIN_SRC emacs-lisp :results table
'((H1 H2 H3) hline (text11 text12 text13) (text21 text22 text23) (... .= .. ...) (textN1 textN2 textN3))
#+END_SRC

HTH,

Chuck



--
Leslie H. Watter
--0000000000002392b405998b6913--