how could I grep exact word's(strings) from xml file. This is the part of xml file (input file):
<Sector sectorNumber="1">
<Cell cellNumber="1" cellIdentity="42901" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
<Cell cellNumber="2" cellIdentity="42905" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
</Sector>
<Sector sectorNumber="2">
<Cell cellNumber="1" cellIdentity="42902" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
<Cell cellNumber="2" cellIdentity="42906" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
</Sector>
<Sector sectorNumber="3">
<Cell cellNumber="1" cellIdentity="42903" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
<Cell cellNumber="2" cellIdentity="42907" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0" />
</Sector>
I want to grep all cellIdentity="..."
, so bascily it should look like this
cellIdentity="42901"
cellIdentity="42905"
cellIdentity="42902"
cellIdentity="42906"
cellIdentity="42903"
cellIdentity="42907"
when I tried with grep -E "cellIdentity=" input.xml
I get whole sentence (line), but I need only as above...