Hi
Is it possible for me to extract particular lines from the text lines below. For example I want to extract the first three lines and the 4 lines below <owner>. I ant to put them in one line like thus:
12.33.164.12 UNITED HEALTHCARE CORP. 6300 OLSEN MEMORIAL HIGHWAY GOLDEN VALLEY, MN 55427 US
I have a file full of data like this and would like to create rows with jsut the IP address and the owner.
sounds like your trying to build your own version of a whois record for some sort of program that logs ip addys of hosts you have "tested" for something.
i think i wont touch this one. but i will point you in teh right direction.
why dont you check out a book by oreilly its called "Mastering Regulard Expressions 2nd edition"
you are right in that I am trying to use the output of an whois report. Thanks for pointing me in the right direction with this. Let me assure you... this is not for spamming. I am jsut getting the output in a tabular manner.
well, if you are using Perl, i think you can easily retrieve those information by using "split" and also "=~" commands to search for the right kind of data that you wish to retrieve.
i have once done this to retrieve the information displayed on the screen by the iptables,
first i saved the screen in a file and then i split them up into pieces for easy lookup. last but not least i use the "=~" commands to look for the right words.
=~ is not a command it is an operator. to be more specific its a binding operator to tie a scalar value to a pattern matching expression which will be on the right side of the operator.