1
votes

Example: input file is like below

 signal {   
    XX, yy,
    Zz 
    XX ck" {
        P { 10ps
            25ps
            100ps }
    }
    yy ck" {
        P { 10ps
            25ps
            100ps }
        }
    Zz ck" {
        P { 10ps
            25ps
            100ps }
        }
    "XX"+, "yy"+, "zz"
}

The output I need is,

   signal {    
        XX, yy,
        Zz 
        "XX"+, "yy"+, "zz"
    }

Above example is part of lines in a file, I should use the sed command to remove the pattern having curly brace till 6 lines in tcl.

used below command,

exec /bin/sed -e {xx ck" { /, +6d} -i file

its not working , its deleting other line also should delete below things,

       Zz ck" {
            P { 10ps
                25ps
                100ps }
            }
       XX ck" {
            P { 10ps
                25ps
                100ps }
          }
       yy ck" {
            P { 10ps
                25ps
                100ps}
            }

Could you help me?

1

1 Answers

0
votes

I'm getting the desired result when using double-quotes ("...") to escape the sed expression instead of using curly braces ({...}):

exec /bin/sed -e "/.. ck\" \{/,+4d" -i file

Note that I've also changed the expression to delete only 4 lines.