Batch editing files with ed
There is another program I use for editing that is older than ed. 
It is written in asm.
I think it may actually be faster than sed (and sed is faster than AWK, Lua, Perl, Python, etc.)<p><pre><code>  1.spt:

  ; x = &quot;  - baz&quot; 
  ; y = &quot;  - elephant&quot;
  ;a a = input :f(end)
  ;  output = a
  ;  a ? x :s(d)f(a) 
  ;d output = y
  ; :(a)
  ;end

  spitbol 1.spt &lt; foo</code></pre>