xml - Grabbing specific lines from block of TEXT -


i have large text (xml?) dump , want out lines containing content.

for example, want 'text here' part grepped out or something. there way grep out throughout file 'values' of 'content' tags?

<mtg:property displayname="content" hidden="false" name="content" nullable="true" readonly="false" type="string">               <mtg:value>text here</mtg:value> </mtg:property> 

thanks help.

awk '/content/ {print $2}' fs='<mtg:value>' rs='</mtg:value>' 
  • set record separator </mtg:value>
  • set field separator <mtg:value>
  • find records containing content , print field 2

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -