in reply to Re^2: Extracting tagged data from a XML file
in thread Extracting tagged data from a XML file
Here is the same but to grap IP addresses from either <IP-ADDRESS> or <IP_NEIGHBOUR> tags.perl -le 'local$/;open F,data;$_=<F>;s/\n//g;while(/<ip-address>(.+?)< +\/ip/gi){print $1}'
perl -le 'local$/;open F,data;$_=<F>;s/\n//g;while(/<ip-(neigbour|addr +ess)>(.+?)<\/ip/gi){print $2}'
Anyway, looking at this thread the OP looks to have changed his mind and not want to capture the <IP-NEIGHBOUR> addresses, as well as wanting only unique addresses returned, I will update this space soon with a version that is more mem friendly and possibly redeem myself in the eyes of the monastery.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Extracting tagged data from a XML file
by davorg (Chancellor) on Aug 31, 2004 at 12:11 UTC |