|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 
|
awk ' {if ( $0 ~ /DC/) print substr($0,index($0,"DC")) }' <filename>
sample run:
original file:
OU=TI,OU=Clientes,OU=TI-RIO,OU=Unidades,DC=crp,DC=pes,DC=biz
OU=TI,OU=Clientes,OU=TI-RIO,OU=Unidades
OU=Unidades,DC=crp2,DC=pes2,DC=biz2
DC=crp,DC=pes,DC=biz,OU=Unidades,DC=crp,DC=pes,DC=biz
this command
awk ' {if ( $0 ~ /DC/) print substr($0,index($0,"DC")) }' filename
produced the following:
DC=crp,DC=pes,DC=biz
DC=crp2,DC=pes2,DC=biz2
DC=crp,DC=pes,DC=biz,OU=Unidades,DC=crp,DC=pes,DC=biz
|