Hi. I am using curl to download a specific web page, basically I need the CustName: from the query run on whois.domaintools.com
If you type an ip address, it will return the organization name. I need only this information saved in a plain text file. I tried using grep -E but it gets messy because there are many   and ;  located after the CustName. Also the string is returned in one long line so grepping for CustName returns that same long line. The characters that follow the information I need are simply a new line which is '<br>'. I need to stop grabbing text up until that point.
So what I do is run
Code:
curl -s http://whois.domaintools.com/ip.addr.of.domain > file
Then I run
Code:
grep -E -o "CustName.{120}" file
The 120 stands for characters after CustName. Much of these are   and ;nbsp. I use 120 to make sure I grab everything. Basically, since the data is all in one line, they use <br> right after the information I need. The Address section is below CustName and that is not what I need. I would only like the information up until the <br>
Here is an example of the output of the above command:
Code:
grep -E -o "CustName.{120}" file
242:CustName: Akamai Technologies<br/>Address: &nbs
As you can see, the only information I want is Akamai Technologies. How can I parse out this data in the most efficient way? Thank you for any help.