Surely this can be done with a simple one line command using sed at a command line? This works for me:

<pre>sed 's/^.*$/prepend text&append text/' inputfile.txt &gt; result.txt</pre>
That'd get around the problem of it not altering the first and possibly last lines in the file using face's method