Re: Need help with a question.
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Sun, 29 Jun 2008 18:45:33 +0100
Quoth Trev <trevor.dodds@xxxxxxxxx>:
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])
Index [1] is the second item in an array. You need to go read a decent
beginner's Perl book: see perldoc -q book.
Ben
--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased] ben@xxxxxxxxxxxx
.
- 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: Trev
- Need help with a question.
- Prev by Date: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- Next by Date: FAQ 9.5 How do I extract URLs?
- Previous by thread: Re: Need help with a question.
- Next by thread: Re: Need help with a question.
- Index(es):
Relevant Pages
|