I have been using replace-in-file node js utility to replace string values in files. Using this utility as it can be called from bash script. However this time there is requirement to replace next line, if I find the given string in previous line. For example,
<values>
<field>Namespace__c</field>
<value xsi:nil="true"/>
</values>
Utility should search Namespace string and if found, it should replace next line i.e.
<value xsi:nil="true"/>
with given value. I tried to do it with regular expression,
module.exports = {
from: '/<field>Namespace__c</field>\n<value xsi:nil="true"/>/g',
to: '<field>Namespace__c</field>\n<value xsi:type="xsd:string">namespace</value>',
files:[ 'path to file/*.md' ],
isRegex: true,
but no success yet. Thanks in advance for help!