text block insert below each line using a vi and/or sed editor -



text block insert below each line using a vi and/or sed editor -

i have need insert block of text below each line using 'vi' and/or 'sed' editor. block of text needs inserted below each line follows ( means blank line):

first line. sec line. ... n-th line. <empty line>

before insert, text follows:

this first line. sec line. ... lastly line.

after insert, text follows:

first line. first line. sec line. ... n-th line. <empty line> sec line. first line. sec line. ... n-th line. <empty line> ... lastly line. first line. sec line. ... n-th line. <empty line>

anyone? give thanks you.

assume block text inserted saved in file called block, file want process called file:

gnu sed:

sed -r '/^/r block' file

sed vi

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -