Hi People:
Could anybody tell me how can I do this with awk?
I've a file with some XML systaxis:
#cat file
<SENT>word1 <ENT> ent1</ENT> word2 word3 word4<ENT>ent2</ENT> </SENT>
<SENT>word5 word6 word7 <ENT>ent3</ENT> word8 word9 word10<ENT>ent4</ENT></SENT>
I need a script that gets all the entities (entX) from a text file, then the 2 previus words(wordX) and 2 words (wordX) afters the ent.
and i need get this:
# -----WORD WORD ENT WORD WORD------
word1 ent1 word2 word3
word3 word4 ent2
word6 word7 ent3 word8 word9
word9 word10 ent4
Thanks in advance and regards! =)
-ric
Could anybody tell me how can I do this with awk?
I've a file with some XML systaxis:
#cat file
<SENT>word1 <ENT> ent1</ENT> word2 word3 word4<ENT>ent2</ENT> </SENT>
<SENT>word5 word6 word7 <ENT>ent3</ENT> word8 word9 word10<ENT>ent4</ENT></SENT>
I need a script that gets all the entities (entX) from a text file, then the 2 previus words(wordX) and 2 words (wordX) afters the ent.
and i need get this:
# -----WORD WORD ENT WORD WORD------
word1 ent1 word2 word3
word3 word4 ent2
word6 word7 ent3 word8 word9
word9 word10 ent4
Thanks in advance and regards! =)
-ric