Awk Parseo

ricardo gamboa <[email protected]>
Newsgroups gmane.org.user-groups.linux.gulcr
Message-ID <[email protected]>
Hola Gente!,Pura vida?

Queria ver si me podian ayudar como hacer esto con un
script en awk,

Tengo un archivo plano con una sintaxys tipo XML:

#cat file
<SENT>pal1<ENT>ent1</ENT>pal2 pal3 pal4<ENT>ent2
</ENT></SENT>
<SENT>pal5 pal6 pal7<ENT>ent3</ENT>pal8 pal9 pal10
<ENT>ent4</ENT>pal11</SENT> 


//OJO: Es <SENT> por linea en el archivo ,ese archivo
tiene 2 lineas

Tiene que obtener todas las entidades(ENT)del archivo,
y mostrar 2 palabras(pal) antes Y 2 palabras despues
de la entidad.

#Patron: --Palabra Palabra ENT Palabra Palabra------

#awk -f script.awk file

El script deberia devolver esto
                     pal1 ent1 pal2 pal3
                pal3 pal4 ent2
                pal6 pal7 ent3 pal8 pal9
               pal9 pal10 ent4 pal11

Muchas Gracias y Saludos!, :)

-ric


 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com

-- 
Desuscripción: escriba a [email protected], tema 'unsubscribe'
Problemas a: [email protected].  http://gulcr.org/ListasDeCorreo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.