I have a file as below . In which I want to remove lines under a particular sub heading alone. I tried using some sed and awk commands but I couldn't get it. Can any one help to crack this with some  linux commands.[first attempt]a=10b=20[second attempt]a=20b=20[third attempt ] a=30b=50I want to remove lines under '[second attempt]' sub heading alone. The output should be as below. I just want to remove the contents under the sub heading and optionally the removed lines can be replaced by one blank line[first attempt]a=10b=20[second attempt][third attempt ] a=30b=50
How can I remove lines under a sub heading in a file using linux commands
text processing;sed;awk