I am using the below SED command:
sed '/cell.* '"alatch {"'/,/^}/p' -n file Input file is as under:
cell abc { pins on T { a b c } } cell xyz { pins on T { x y z } } cell alatch { pins on T { VSS VDDPI VDDP } pins on L { IN CT CB } pins on R { OUT } inputs { CB CT IN } outputs { OUT } } cell alatch { pins on T { VSS VDDPI VDDP } pins on L { IN CT CB } pins on R { OUT } inputs { CB CT IN } outputs { OUT } } Output is as under:
cell alatch { pins on T { VSS VDDPI VDDP } pins on L { IN CT CB } pins on R { OUT } inputs { CB CT IN } outputs { OUT } } cell alatch { pins on T { VSS VDDPI VDDP } pins on L { IN CT CB } pins on R { OUT } inputs { CB CT IN } outputs { OUT } } Expected out is as under:
cell alatch { pins on T { VSS VDDPI VDDP } pins on L { IN CT CB } pins on R { OUT } inputs { CB CT IN } outputs { OUT } } What is needed is that only the first occurrence should be the output. Any suggestion for command?
sedcommand. How about'/cell.* alatch {/,/^}/p'as a start?