Hello All
As I new to sed command, I struck in the issue. What I want to do is
Suppose I have the file which contain data, I will pass two pattern and the lines which are between to patterns should be deleted and replaces by deleted
Example Suppose I have the data
a b c d e
I will give two pattern suppose a and e
so the output should be
a deleted b
Something like..
echo "a b c d e" | sed 's/a .* e/a deleted e/'
Hi All
The actual data is
if (starting_phase != null) begin
.... any number of lines can be there
`ovm_info(get_full_name(), "sequence ovmEthGmiiHalfDuplex", OVM_LOW);
.... any number of lines can be there
starting_phase.raise_objection(this);
end
If it found such type of pattern it should replace the whole pattern with deleted. Its better if we can use it with Perl in one line script
Try the following...
sed '
/^if (starting_phase != null) begin$/,/^end$/ c\
*** DELETED ***
' your-file