emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Best way to template a big table
@ 2019-12-12  6:05 Lawrence Bottorff
  2019-12-12 11:26 ` Simon Butler
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Bottorff @ 2019-12-12  6:05 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

I've got a big table that I would like to create a template for, i.e., the
rows and columns and the myriad | and -. Then a key chord would produce it
in an org file ready for values to be entered. I've seen the post-9.2
tempo-define-template, but that looks more suited to smaller things. There
is Emacs Skeleton, but I'd like to ask people who perhaps have faced this
issue before for a "best practice" answer.

LB

[-- Attachment #2: Type: text/html, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best way to template a big table
  2019-12-12  6:05 Best way to template a big table Lawrence Bottorff
@ 2019-12-12 11:26 ` Simon Butler
  2019-12-12 16:03   ` Lawrence Bottorff
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Butler @ 2019-12-12 11:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi

On 2019-12-12 07:05, Lawrence Bottorff wrote:
> I've got a big table that I would like to create a template for, i.e.,
> the rows and columns and the myriad | and -. Then a key chord would
> produce it in an org file ready for values to be entered. I've seen
> the post-9.2 tempo-define-template, but that looks more suited to
> smaller things. There is Emacs Skeleton, but I'd like to ask people
> who perhaps have faced this issue before for a "best practice" answer.
>
> LB

Not sure about 'best practice', but yasnippet works well.

Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best way to template a big table
  2019-12-12 11:26 ` Simon Butler
@ 2019-12-12 16:03   ` Lawrence Bottorff
  2019-12-12 18:29     ` Berry, Charles
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Bottorff @ 2019-12-12 16:03 UTC (permalink / raw)
  To: Simon Butler; +Cc: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

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. . . .

On Thu, Dec 12, 2019 at 5:29 AM Simon Butler <simon@floss.nu> wrote:

> Hi
>
> On 2019-12-12 07:05, Lawrence Bottorff wrote:
> > I've got a big table that I would like to create a template for, i.e.,
> > the rows and columns and the myriad | and -. Then a key chord would
> > produce it in an org file ready for values to be entered. I've seen
> > the post-9.2 tempo-define-template, but that looks more suited to
> > smaller things. There is Emacs Skeleton, but I'd like to ask people
> > who perhaps have faced this issue before for a "best practice" answer.
> >
> > LB
>
> Not sure about 'best practice', but yasnippet works well.
>
> Simon
>
>
>

[-- Attachment #2: Type: text/html, Size: 1696 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best way to template a big table
  2019-12-12 16:03   ` Lawrence Bottorff
@ 2019-12-12 18:29     ` Berry, Charles
  2019-12-13  1:01       ` Leslie Watter
  0 siblings, 1 reply; 5+ messages in thread
From: Berry, Charles @ 2019-12-12 18:29 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist, Simon Butler



> 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     | 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best way to template a big table
  2019-12-12 18:29     ` Berry, Charles
@ 2019-12-13  1:01       ` Leslie Watter
  0 siblings, 0 replies; 5+ messages in thread
From: Leslie Watter @ 2019-12-13  1:01 UTC (permalink / raw)
  To: Berry, Charles; +Cc: Simon Butler, emacs-orgmode Mailinglist, Lawrence Bottorff

[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]

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 <ccberry@health.ucsd.edu>
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     | 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

[-- Attachment #2: Type: text/html, Size: 2983 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-13  1:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-12  6:05 Best way to template a big table Lawrence Bottorff
2019-12-12 11:26 ` Simon Butler
2019-12-12 16:03   ` Lawrence Bottorff
2019-12-12 18:29     ` Berry, Charles
2019-12-13  1:01       ` Leslie Watter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).