Re: Need help with a question.
- From: "J. Gleixner" <glex_no-spam@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 11:13:34 -0500
Trev wrote:
I'm only after 1 line (MAC) per server, which is value [1] the other
MAC's I do not need. Is it possible to grep MAC from the Array (Entire
File) and pass the results into a new array which I could then
print[1] to a file. This will then extract 1 line for every server
that I have an xml file for.
Maybe this will help...
Read list.txt for each server listed do
read xml file into array
find results matching MAC
print the 1st MAC address only ($server,$mac[1])
go back to list.txt and do the same for next server listed in file.
That's what I'm trying to do with this perl script.
Since you're parsing an XML file, possibly using XML::Simple
will make it much easier.
http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm
.
- References:
- Need help with a question.
- From: Trev
- Re: Need help with a question.
- From: Ben Morrow
- Re: Need help with a question.
- From: Trev
- Re: Need help with a question.
- From: Ben Morrow
- Re: Need help with a question.
- From: Trev
- Re: Need help with a question.
- From: Trev
- Need help with a question.
- Prev by Date: Re: looping issue
- Next by Date: Re: Thread or threads.
- Previous by thread: Re: Need help with a question.
- Next by thread: [OT] Read the Posting Guidelines (was: Need help with a question.)
- Index(es):
Relevant Pages
|