Search code examples
regexdxf

DXF→element only


Thank you in advance and sorry for the bad english!

What I have tried:

DXF file

Find: \r\n

Replace: @@@

Find: (.*)(?=ENTITIES)

Replace: $2

Find: @@@

Replace: \n

Find: ENTITIES

Replace: 0\nSECTION\n2\n\ENTITIES

replace - Currently 4 times

I want to replace only once


Solution

  • (AWK)

    BEGIN{isw=0;print"  0";print"SECTION";print"  2";}
    /^ENTITIES$/{isw=1}
    isw==1{print $0}