MIA651
1
Hi I just wanted to add a new line after every matching pattern:
The method doing this doesn't matter, however, I have been using sed and this is what I tried doing, knowing that I am a bit off:
sed 'Wf a\'/n'/g'
Basically, I want to add a new line after occurrence of Wf. After the line Wf is in and not after Wf itself.
sed 's/Wf/&\
/g' file
or
sed 's/Wf/\
&/g' file
depending on how you want it.
\n would work with GNU sed:
sed 's/Wf/&\n/g' file
MIA651
4
Thanks elixir_sinari but this is after Wf, I want a line appended after the line Wf occurs if you know what I mean.
sed '/.*Wf.*/s//&\
/' file
or
sed '/Wf/a\
' file