I am trying to remove lines from a text file that start with a particular string and does not contain a string.
For example I would like to simply delete all lines as below from a file. The below line starts with connect_bd_net and does not contain any text that is Clk or clock etc. Note that the line begins with a space
connect_bd_net -net aux_reset_in_1 [get_bd_pins hls_rstn] [get_bd_pins proc_sys_reset_1/aux_reset_in]
While at it I would like to not delete the following line
connect_bd_net -net rx_acr_aud_clk_out [get_bd_pins aud_clk_out_0] [get_bd_pins rx_acr/aud_clk_out]
Here are my attempt with sed
sed 's/^(.+connect_bd_net.+(?!\bcl.+k).)*$//g' input.tcl
sed '/^(.+connect_bd_net.+(?!\bcl.+k).)*$/d' input.tcl