bojomojo 0 Newbie Poster

Hello,

I have in a file some text, the area I am concerned in is:

#COMMAND TRUE
#COMMAND2 TRUE (anytext)1
#ENDCOMMAND

I want it to be changed to

#COMMAND2 TRUE 1

.. Please note that I dont want all "#ENDCOMMAND"s to be deleted, as there are some not associated with the same patter.

If I can make sed match multiple line patterns it will be good

Edit:
I found a solution on http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/

The problem is it matches between the first occurence of #COMMAND and the last occurence of #ENDCOMMAND, I want it to check for the first of both

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.