Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Extracing (and excluding) IP's from a file

by mjscott2702 (Pilgrim)
on Nov 09, 2010 at 15:39 UTC ( #870322=note: print w/replies, xml ) Need Help??


in reply to Extracing (and excluding) IP's from a file

while(<>) { next until /vfiler1/; print (split)[2], "\n" if /^IP address:/; }

which would consume lines until the "vfiler1" line, then split lines beginnning with "IP address" on whitespace and print the third field - the address you are looking for.

Not tested! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://870322]
help
Chatterbox?
[ambrus]: My boss wants to generate output data that is impossible to compute from the inputs we have. And I'm trying to convince him that he shouldn't do that.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-12-12 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (332 votes). Check out past polls.

    Notices?