emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob f9b73125a8f05ccc945b21b93fdeb8da45d92397 829 bytes (raw)
name: testing/examples/ob-awk-test.org 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
#+Title: a collection of examples for ob-awk tests
#+OPTIONS: ^:nil

* Simple tests
  :PROPERTIES:
  :ID:       9e998b2a-3581-43fe-b26d-07d3c507b86a
  :END:
Run without input stream
#+begin_src awk :output silent :results silent
  BEGIN {
      print 42
  }
#+end_src

Use a code block output as an input
#+begin_src awk  :stdin genseq :results silent
  {
      print 42+$1
  }
#+end_src

Use input file
#+name: genfile
#+begin_src awk  :in-file ob-awk-test.in :results silent
    $0~/[\t]*#/{
        # skip comments 
        next
    }
    { 
        print $1*10
    }
#+end_src

#+name: awk-table-input
| a | b | c |

#+begin_src awk :var a=awk-table-input
  BEGIN{ print a; }
#+end_src

* Input data generators
A code block to generate input stream
#+name: genseq
#+begin_src emacs-lisp :results silent
(print "1")
#+end_src

debug log:

solving f9b73125a ...
found f9b73125a in https://git.savannah.gnu.org/cgit/emacs/org-mode.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).