From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Millar Subject: Re: evaluate TBLFM Date: Sun, 26 Jul 2015 10:01:26 -0400 Message-ID: <55B4E836.1090000@verizon.net> References: <5579E556.8090104@verizon.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=------------030005040408080607020400 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJMUq-0002iy-0i for emacs-orgmode@gnu.org; Sun, 26 Jul 2015 10:01:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJMUl-0007ML-0J for emacs-orgmode@gnu.org; Sun, 26 Jul 2015 10:01:43 -0400 Received: from vms173025pub.verizon.net ([206.46.173.25]:58845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJMUk-0007M9-Qv for emacs-orgmode@gnu.org; Sun, 26 Jul 2015 10:01:38 -0400 Received: from [192.168.1.128] ([70.209.140.70]) by vms173025.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NS30080NLMEE9H0@vms173025.mailsrvcs.net> for emacs-orgmode@gnu.org; Sun, 26 Jul 2015 09:01:33 -0500 (CDT) In-reply-to: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" This is a multi-part message in MIME format. --------------030005040408080607020400 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi Grant, On 07/21/2015 09:28 AM, Grant Rettke wrote: > On Thu, Jun 11, 2015 at 2:45 PM, Charles Millar wrote: >> I am learning how to use org-babel and want to export (LaTeX) a table with >> the final column added at final row, which should be inserted. The entire >> process would take place upon exporting to LaTeX/pdf >> >> Desired result (roughly speaking) >> >> | date | Description | Amount | >> |--------|----------------|---------------| >> | 6-7 | blah | 1.00 | >> | 6-8 | blah blah | 2.00 | >> | | | 3.00 | (this row to be inserted >> and then column 3 added) (Also nice if a hline were inserted before the last >> row) >> >> The table is generated from a recutils data base and essentially this is the >> set up >> >> >> #+Name: ATable >> #+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount >> #+end_src >> >> #+TBLNAME: ATable >> #+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f >> >> I have read Using Code Blocks in Org Tables in the Worg Babel Introduction >> and searched the lists and am not sure of how to implement this. > I'm not sure what you are trying to perform with this code. That > probably says more about me than you. > > Are you loading the contents of a recfile into an Org-Mode table and > them performing a manipulation on that table? Is that what you want to > do? You said that you are not sure how to implement this and I am not > sure what precisely you want to implement. > By the time I arrived at the end of my message the question was vague - very vague! I have no trouble generating a table using the a src block from a recutils file #+Name: ATable #+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount #+end_src #+TBLNAME: ATable results in #+Name: ATable #+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount #+end_src #+TBLNAME: ATable | date | Description | Amount | |--------|-------------|--------| | 6-7 | blah | 1.00 | | 6-8 | blah blah | 2.00 | Using code I would like to insert a row after the last row from the recutil file, put the word "Total" in the last cell in the "Description" column and in the last cell in the Amount column total the cells above. From what I have read, I think source code at the beginning of the file would be possible and then that code would be called using the :post header command the desired result is #+Name: ATable #+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount (possibly wiht :post *this* #+end_src #+TBLNAME: ATable | date | Description | Amount | |--------|-------------|--------| | 6-7 | blah | 1.00 | | 6-8 | blah blah | 2.00 | | | Total | 3.00 | I want to avoid using the keyboard to modify the table, i.e. go to last row, M-S- to add a row, go to "Description" column last cell and insert Total and then evaluate a #+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f (Eventually there may be as many as twenty different tables; the above is the most simple type.) My knowledge of emacs lisp is only enough to try to figure it out when I see the code; all other languages forget about it. Charlie Millar --------------030005040408080607020400 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit Hi Grant,

On 07/21/2015 09:28 AM, Grant Rettke wrote:
On Thu, Jun 11, 2015 at 2:45 PM, Charles Millar <millarc@verizon.net> wrote:
I am learning how to use org-babel and want to export (LaTeX) a table with
the final column added at final row, which should be inserted. The entire
process would take place upon exporting to LaTeX/pdf

Desired result (roughly speaking)

| date | Description | Amount    |
|--------|----------------|---------------|
| 6-7   | blah            |     1.00      |
| 6-8   | blah blah    |    2.00       |
|         |                    |    3.00        | (this row to be inserted
and then column 3 added) (Also nice if a hline were inserted before the last
row)

The table is generated from a recutils data base and essentially this is the
set up


#+Name: ATable
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount
#+end_src

#+TBLNAME: ATable
#+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f

I have read Using Code Blocks in Org Tables in the Worg Babel Introduction
and searched the lists and am not sure of how to implement this.
I'm not sure what you are trying to perform with this code. That
probably says more about me than you.

Are you loading the contents of a recfile into an Org-Mode table and
them performing a manipulation on that table? Is that what you want to
do? You said that you are not sure how to implement this and I am not
sure what precisely you want to implement.

By the time I arrived at the end of my message the question was vague - very vague!

I have no trouble generating a table using the a src block from a recutils file
#+Name: ATable
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount
#+end_src
#+TBLNAME: ATable
results in 

#+Name: ATable
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount
#+end_src
#+TBLNAME: ATable
| date   | Description | Amount |
|--------|-------------|--------|
| 6-7    | blah        |  1.00  |
| 6-8    | blah blah   |  2.00  |

Using code I would like to insert a row after the last row from the recutil file, put the word "Total" in  the last cell in the "Description" column and in the last cell in the Amount column total the cells above.  

>From what I have read, I think source code at the beginning of the file would be possible and then that code would be called using the :post header command

the desired result is

#+Name: ATable
#+begin_src rec data: Foo.rec :type Bar :fields date,Description,Amount (possibly wiht :post *this*
#+end_src
#+TBLNAME: ATable
| date   | Description | Amount |
|--------|-------------|--------|
| 6-7    | blah        |  1.00  |
| 6-8    | blah blah   |  2.00  |
|	 | Total       |  3.00  |


I want to avoid using the keyboard to modify the table, i.e. go to last row, M-S-<down> to add a row, go to "Description" column last cell and insert Total and then evaluate a 
	#+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f
(Eventually there may be as many as twenty different tables; the above is the most simple type.)

My knowledge of emacs lisp is only enough to try to figure it out when I see the code; all other languages forget about it.

Charlie Millar 

  


--------------030005040408080607020400--