[Solved] Grep a word from XML file with grep/sed


$ sed -nr '/Username/{n;s#.*>(.*)<.*#\1#p}' file
wipis_dxu

Brief explanation,

  • /Username/: find Username
  • n: Read the next line of input
  • s#.*>(.*)<.*#\1#p: extract the string between > ... <

2

solved Grep a word from XML file with grep/sed