次の繰り返しパターンを含むファイルがあります。
set m [ meas new $proj rajesh ]
meas $m set_type lvf_timing
abcde erft 1213
234 456 897 00000000000000
once upon a time
set t [ table new $m pvbt_table ]
table $t set_region_set_name lvf_clusters
table $t set_instance_condition derate_instance_condition
table $t set_corner_condition derate_corner_condition
set a [ axis new $t parameter_axis CPS]
set a [ axis new $t parameter_axis RPB]
set a [ axis new $t parameter_axis periphery_Vt]
set a [ axis new $t process_axis]
set a [ axis new $t voltage_axis]
set a [ axis new $t temperature_axis]
set a [ axis new $t bias_axis vdda]
set t [ table new $m table ]
table $t set_equation {derate_equation pvbt_table}
table $t set_region_set_name lvf_clusters
table $t set_corner_condition derate_corner_condition
set a [ axis new $t parameter_axis CPS]
set a [ axis new $t parameter_axis RPB]
set a [ axis new $t parameter_axis periphery_Vt]
set a [ axis new $t process_axis]
set a [ axis new $t voltage_axis]
set a [ axis new $t temperature_axis]
set a [ axis new $t bias_axis vdda]
これらすべてのパターンが次のように変更されるようにファイルを処理したいと思います。
set m [ meas new $proj rajesh ]
meas $m set_type lvf_timing
abcde erft 1213
234 456 897 00000000000000
once upon a time
set t [ table new $m table ]
table $t set_region_set_name lvf_clusters
table $t set_corner_condition derate_corner_condition
set a [ axis new $t parameter_axis CPS]
set a [ axis new $t parameter_axis RPB]
set a [ axis new $t parameter_axis periphery_Vt]
set a [ axis new $t process_axis]
set a [ axis new $t voltage_axis]
set a [ axis new $t temperature_axis]
set a [ axis new $t bias_axis vdda]
答え1
次のようなものが必要です。
sed '/table new.*pvbt_table/, /^$/d;/pvbt_table/d' input_file