emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Org-Babel and Ledger
Date: Fri, 13 Aug 2010 13:33:20 +0200	[thread overview]
Message-ID: <87fwyizr0f.fsf@mundaneum.com> (raw)
In-Reply-To: 87zkwqzx0p.fsf@mundaneum.com

Hi Eric,

Sébastien Vauban wrote:
> "Eric Schulte" wrote:
>> Sébastien Vauban writes:
>>>
>>>>>> As you can see, the tables are completely wrongly made, because they're
>>>>>> based on spaces ("à la Awk") and not on fixed position of fields ("à la
>>>>>> Cut").
>>>>>>
>>>>>> What can I do about this?
>>>>>>
>>>>>> - Post-process every ledger command with some awk or cut command that
>>>>>>   will do whatever is needed
>>>>
>>>> 	(org-table-convert-region (point-min) (point-max))

As you adviced, I can play with the optional parameter in ob-ledger's code.

But what about the results of sh code?

Imagine now that I'm forced to use =sh= instead of =ledger=, in the following
pratical case:

#+srcname: reg
#+begin_src sh
m4 scorpios-ledger.dat | ledger -f - reg unknown
#+end_src

I'm using =m4= (and thus make some pre-processing) because I need (or want) to
be able to switch between =ledger= and =hledger= and comment in or out the
directives that are accepted by one but not by the other.

Then, such a result is still problematic:

--8<---------------cut here---------------start------------->8---
09-Aug-21 CHEQUE : 9953055                    Expenses:Unknown                                    166.70 EUR            166.70 EUR
09-Sep-17 CHEQUE : 7691785                    Expenses:Unknown                                    100.00 EUR            266.70 EUR
09-Oct-16 REMISE CHEQUE N 8686318 001 105     Expenses:Unknown                                   -525.00 EUR           -258.30 EUR
--8<---------------cut here---------------end--------------->8---

I've looked in =org-babel-execute:sh= and =org-babel-reassemble-table=, among
others, to look for similar constructs (calls to =org-table-convert-region=)
but did not find any.

Is there still a solution to get such results?

--8<---------------cut here---------------start------------->8---
#+results:
| 09-Aug-21 CHEQUE : 9953055                | Expenses:Unknown | 166.70 EUR  | 166.70 EUR  |
| 09-Sep-17 CHEQUE : 7691785                | Expenses:Unknown | 100.00 EUR  | 266.70 EUR  |
| 09-Oct-16 REMISE CHEQUE N 8686318 001 105 | Expenses:Unknown | -525.00 EUR | -258.30 EUR |
--8<---------------cut here---------------end--------------->8---

Couldn't we specify somehow the field separator as an extra header argument?
I've looked for such an already existing in
http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments,
but that does not seem to be available yet. Though, I do not know if this is
the right solution. I'm sure you'll tell me... ;-)

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-08-13 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29  9:40 Org-Babel and Ledger Sébastien Vauban
2010-07-29 16:33 ` Eric Abrahamsen
2010-07-30 20:47   ` Eric Schulte
2010-08-12 11:45     ` Sébastien Vauban
2010-08-12 22:57       ` Eric Schulte
2010-08-13  9:23         ` Sébastien Vauban
2010-08-13 11:33           ` Sébastien Vauban [this message]
2010-08-13 17:41             ` Eric Schulte
2010-08-13 19:04               ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fwyizr0f.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).