Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    3

    Unanswered: Unix newbie, string parsing

    hi,

    i need to parse a large XML file, which contains one element:

    <subject>NNR</subject>

    I need to extract NNR in this example. Any knows how i can do this? The subject occurs only ones. Can use grep or something simple.

    thanks

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Exclamation

    Try this:

    grep '<subject>' XMLfile.txt|cut -d\> -f2|cut -d\< -f1

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •