Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hI I am having a big file having content of file like this
pin (PIN1) {
direction : input ;
capacitance : 0.016700 ;
max_transition : 0.4000 ;
}pin (PIN1) {
direction : input ;
clock : true ;
capacitance : 0.016700 ;
max_transition : 0.4000 ;
timing () {
timing_type : min_pulse_width ;
related_pin : "RXAUPTSTART" ;
fall_constraint (pulse_width_template_2x1) {
index_1 ("0.0010, 0.5000") ;
values ("20, 20") ;
}
rise_constraint (pulse_width_template_2x1) {
index_1 ("0.0010, 0.5000") ;
values ("20, 20") ;
}
}
}I need to search the pattern P1 and delete the first block , it should not touch the second Block
So the rest of the file content will be :
pin (PIN1) {
direction : input ;
clock : true ;
capacitance : 0.016700 ;
max_transition : 0.4000 ;
timing () {
timing_type : min_pulse_width ;
related_pin : "RXAUPTSTART" ;
fall_constraint (pulse_width_template_2x1) {
index_1 ("0.0010, 0.5000") ;
values ("20, 20") ;
}
rise_constraint (pulse_width_template_2x1) {
index_1 ("0.0010, 0.5000") ;
values ("20, 20") ;
}
}
}Hi I have written a awk script like this
awk '/PIN1/{c==4};--c<0' fileBut it is deleting the content from second Block also
Thanks neha

![]() |
control panel
|
Easy Disable/Enable CD RO...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |