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

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -