Re: Need help with a question.



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
.



Relevant Pages

  • Re: Need help with a question.
    ... I'm only after 1 line (MAC) per server, which is value the other ... File) and pass the results into a new array which I could then ... that I have an xml file for. ...
    (comp.lang.perl.misc)
  • RE: Arrays, Got Me Confused
    ... Thanks for that Tim and Steve, ... Basically I'm trying to create a class that contains an array of MAC ... Python has two central datastructures ...
    (comp.lang.python)
  • Re: Arrays, Got Me Confused
    ... Wider fragments of code don't really exists at this moment in time:-D this ... Basically I'm trying to create a class that contains an array of MAC ... Python has two central datastructures ...
    (comp.lang.python)
  • Re: porting windows to mac byte swapping issue
    ... I am getting some data in an unsigned character array ... >> Now I need to port the code on Mac PPC as well as Intel baesd Mac. ... either architecture - unless they have not fully stated the problem. ...
    (comp.sys.mac.programmer.help)
  • Re: MAC question
    ... but how does one create a MAC of a byte array? ... taking that byte array and transforming it into a string. ... void update(bytein, int inOff, int len) ...
    (sci.crypt)