Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Welcome! Is it not the 4th line, not the 3rd? Commented Mar 20, 2020 at 14:32
  • Please clarify if you're trying to match on the 5th occurrence of <moduleId>PSC-Task5555</moduleId>\n<errorCode>444</errorCode> (with those specific values), or just trying to update the 5th <alarmSpecification line or something else, i.e. tell us what the match/pattern actually IS in your question. Commented Mar 20, 2020 at 15:46
  • Hi, Situation is like ,I am upgrading a linux server. Post version upgrade, lot of new error codes and corresponding tasks (1111 or 2222 or3333 etc) will get added in alarms.xml file. Now I want to update "active=no" when I find below 2 parameters in consecutive lines. <moduleId>PSC-Task5555</moduleId> <errorCode>444</errorCode>. Please note that this error code (444) and taskID (task111 etc) will be there in alarm.xml many times. So I can not just match either of them and change the active=no. I have to make sure both lines are consecutive then change happen. Commented Mar 21, 2020 at 18:53