Inserting a line in a file after every alternate line

Friends ,

I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.

 
 
My File
 
control station *ATM*  , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM*  , qread $OSS.Jul13A.FI02 interval 1 intcount 1
control station *ATM*  , qread $OSS.Jul13A.FI03 interval 1 intcount 1
control station *ATM*  , qread $OSS.Jul13A.FI04 interval 1 intcount 1
 
My Proposed file :
 
control station *ATM*  , qread $OSS.Jul13A.FI01 interval 1 intcount 1
Delay 1
control station *ATM*  , qread $OSS.Jul13A.FI02 interval 1 intcount 1
Delay 1
control station *ATM*  , qread $OSS.Jul13A.FI03 interval 1 intcount 1
Delay 1
control station *ATM*  , qread $OSS.Jul13A.FI04 interval 1 intcount 1
Delay 1
 
awk '{print $0 RS "Delay 1"}' file > newfile
1 Like
 sed 's/$/\nDelay1/g' file

may not work with other sed then gsed

Edit:

with non gsed:

sed 's/$/\^JDelay1/g' file

^J

is control v + control j

1 Like
sed 'a\
Delay 1
'

Regards,
Alister

Thanks guys...Both the option worked.But i am using Franklin's solution in my script.