From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: org babel support for tcl and awk Date: Thu, 26 May 2011 07:03:34 -0600 Message-ID: <87k4ddmvj2.fsf@gmail.com> References: <20110524113109.fo2dcd0mwno0c4w4@webmail.dds.nl> <8739k46z2p.fsf@gmail.com> <874o4kvvcb.fsf@ucl.ac.uk> <87vcwz9b02.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPam2-0001UB-Kf for emacs-orgmode@gnu.org; Thu, 26 May 2011 09:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPam1-0004fA-Gv for emacs-orgmode@gnu.org; Thu, 26 May 2011 09:38:50 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:53646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPam1-0004f5-E6 for emacs-orgmode@gnu.org; Thu, 26 May 2011 09:38:49 -0400 Received: by ywa1 with SMTP id 1so421354ywa.0 for ; Thu, 26 May 2011 06:38:48 -0700 (PDT) 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 Eric Schulte writes: > Eric S Fraga writes: > >> Eric Schulte 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. > I've now added ob-awk.el to the Org-mode core. The newest version incorporates some change inspired by recent work with Sebastien, notably :stdin is now its own header argument, rather than a special variable name. Best -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/