From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: How to pass a block of text to a code block as data? Date: Fri, 08 Feb 2013 21:17:32 +0100 Message-ID: <8638x6y2zn.fsf@somewhere.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Michael, Michael Baum wrote: > I haven't been able to figure this out from the org-mode documents yet. > What I would like to do is have a source code block in python or perl or > something similar. to which I can pass a reference to several lines of text > that the source code block, when evaluated, would then act on. Which would > involve iterating through the data text one line at a time and writing the > output to a buffer. > > The text data could be indicated by a specific headline or a named block of > some sort or maybe an internal link, I'm not particularly fussy just so > there's a mechanism to do this. > > Would appreciate any guidance. #+name: lines-of-text : I haven't been able to figure this out from the org-mode documents yet. : What I would like to do is have a source code block in python or perl or : something similar. to which I can pass a reference to several lines of text : that the source code block, when evaluated, would then act on. Which would : involve iterating through the data text one line at a time and writing the : output to a buffer. #+begin_src sh :stdin lines-of-text :results output grep would #+end_src #+results: #+begin_example What I would like to do is have a source code block in python or perl or that the source code block, when evaluated, would then act on. Which would #+end_example Best regards, Seb -- Sebastien Vauban