I have sample file as follow :
WEA {
Direction = Input
Tag = WriteEnable
PortId = "A"
}
MEA {
Direction = Input
Tag = MemoryEnable
PortId = "A"
}
CLKA {
Direction = Input
Tag = Clock
PortId = "A"
}
TEST1A {
Direction = Input
Tag = None
TieLevel = TestBench
PortId = "A"
SafeValue = "1'b0"
}
I am trying to replace PortId = "A" as PortId = "A B" but in only the CLKA{ } module.
I tried to run certain modification on code given as
sed ':again;$\!N;$\!b again; s/{[^}]*}//g' file
on previous post remove text within curly brackets
I tried this sed ':again;$\!N;$\!b again; s/CLKA {[^}]*}//g' but deleted whole CLKA { } module
appendfunction too?sed -i '/start_pattern/,/end_patter/ { /replace_mark/ a <text_line_to_be_added> } ' <file.txt>– JigarGandhi May 05 '17 at 04:00