ALTER TABLE variable ADD KEY somekey name
I want to remove the line from a text file and the sed mentioned below is working as expected.
sed '/ADD\ KEY/d'
But it’s possible that the word “ADD KEY” may be somewhere else in the text file and I do not want to remove that line.
How do I remove all the “ADD KEY” lines only if it starts with “ALTER TABLE” word?
should do the job as well. You don’t need to mask a blank, by the way.