Hello, I have a block of code (XML) that I would like to grep for certain information. The basic format of the XML is the following repeated a few hundred times, each time with a unique ID:
<Identifier ID="A" NAME="John Doe" AGE="32 Years" FAMILY="4" SEX="MALE"></Identfier>
I would like to create a statement that grabs the ID, Name, and Age of the individual.
What I've done so far is grep the XML file with the following:
grep "ID=" file1.xml
but when I do so, I get the entire line. Is there a command I can use that would give me an output similar to the following?:
HTML Code:
A John Doe 32 Years