Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

here is a sample for my text file:

<w:r><w:t>
<w:r w:rsidR="00D171FD">
<w:t></w:t>
</w:r><w:r>
<w:t xml:space="preserve">
This is a sample text </w:t>
</w:r>
<w:highlight w:val="green"/>
<w:r w:rsidR="00D171FD">
<w:color w:val="FF0000"/>
<w:t>
Sample text</w:t>
</w:r>

The problem is that I need both the pure text and the following tags only:
color w:val="FF0000"
highlight w:val="green"

How can this be done?

share|improve this question
    
Could you post your expected output from sed or awk? You might be better of with a xml parser for this, see e.g. unix.stackexchange.com/a/64708/8677 –  N.N. Mar 8 '13 at 16:34
    
I think I'm gonna make a script to do it, Thanks. –  Mina Mohsen Mar 8 '13 at 17:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.