[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org babel support for tcl and awk

From: Eric Schulte
Subject: Re: [O] org babel support for tcl and awk
Date: Tue, 24 May 2011 13:03:41 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Eric S Fraga <address@hidden> writes:

> Eric Schulte <address@hidden> writes:
> [...]
>> As an example, I've worked up an very simple ob-awk.el file from
>> ob-template.el, it is attached along with an example org-mode file which
>> demonstrates its usage.
> Eric,
> this is great to see as I use awk quite often.  What is involved in
> extending this to be able to run an awk script on input from within the
> org file (output of another babel block, for instance, as my typical use
> of awk is to re-arrange output from another program...)?  Or, if you
> wish, can you suggest one of the ob-XXX modules that best illustrates
> how to do this and I can give it a try?

I've made a quick change so that any variable named "stdin" is treated
specially, in that, rather than using its value to replace strings of
$stdin in the text of the awk code, the value of the stdin variable is
saved into the file processed by awk.  This allows awk to operate over
Org-mode references.

See the attached example file.

If babel code block supported a pipe or an actual stdin header argument,
that would be the ideal way to add this behavior, but currently nothing
of that nature exists.

Please let me know if this misses part of your suggestion, or more
generally what else may be advisable before we add this to the core.

Cheers -- Eric

Attachment: example.org
Description: Text Data

Attachment: ob-awk.el
Description: application/emacs-lisp

> Thanks,
> eric

Eric Schulte

reply via email to

[Prev in Thread] Current Thread [Next in Thread]