I have to extract Hostname and IP address which are the strings after Hostnames:
and IP Address:
from a text cell as shown below, one cell may have multiple Hostnames and IP addresses, and I have many cells as such:
Here my sample data:
Please refer to CR_Implementation_Reversion_Plan UNIX and Informatica (9.1)
--------------------
IP Address: 10.89.140.123, 10.89.140.125, 10.89.140.127, 10.89.140.92
Hostname: a01gbiapp1a, a01gbiapp1b, a01gbiapp1z, w01ggdwtd1a
Informatica ID: proddeploy(Informatica)
Unix ID:cbitimpl, root(su- bipadm,pdm, bipxtr, bdwadm, cpmsadm, dqadm, rmgadm, cbgadm, bdwxtr, hkb2adm, biptwadm, bipinadm, bipcnadm, biphkadm, bipidadm, bipotadm)
UNIX and Informatica (7.1)
--------------------
IP Address: 10.89.140.52, 10.89.140.53, 10.89.140.37, 10.89.140.37
Hostname: a01ginf1a , a01ginf1b, a01ginf1z, a01ginf1z
Informatica ID: proddeploy(Informatica)
Unix ID: cbitimpl, root(su- bipadm, bipdm, bipxtr, bdwadm, cpmsadm, dqadm, rmgadm, cbgadm, bdwxtr, hkb2adm, biptwadm, bipinadm, bipcnadm, biphkadm, bipidadm, bipotadm)
Teradata
--------
IP Address: 10.89.140.97
Hostname: r01gtddb1a
ID: fdwadmin, bdwadmin
InformaticaClient
------------------
w01gdnv1a or w01ggdwtd1a or w01ggdwtd10a 10.89.140.92(Informatica Client),
ID: infadeploy
BO implementation:Draw Rack Keys:
-------------------------------------
IP Address: 10.89.140.105, 10.89.140.106, 10.89.140.48, 10.89.140.49
Hostname: W01GBOXIAPP1A, W01GBOXIAPP2A, W01GBOXIAPP3A, W01GBOXIAPP4A
BO ID: boimpl
SAS
---
IP Address: 10.89.136.122, 10.89.136.125, 10.89.136.126
Hostname: w01gsaseapp1a, a01gsaseapp1a, a01gsaseapp2a
SAS ID: sas_impl
Power Exchange
--------------
IP ADDRESS: 10.80.250.73
ID: DMSDDTL1, DMSDDTL2, DMSDDTL3
UI
---
IP: 10.89.140.112
Hostname: A01GWAWEB1A
ID: wasuser
WODM
----
IP: 10.89.140.109
Hostname: A01GWABRE1A
ID: wodmadm
DB2 Server
----------
IP: 10.89.140.113
DB : DBSWATS
Schema : watsusr
DBS_IBMSG_BTEAM:
Pls allow Ramakishore M/ Prashanth Badugu/ Srinivasa Theerdhala Part B and Satish Parmarthy / Dileep EP / Krishna Reddy / Raghavendra Goud Part A to withdraw the
"infaoper" and "proddeploy" ID for server a01gbiapp1a, a01gbiapp1b, a01gbiapp1z.
I have used Perl to extract strings from HTML file like this:
if ($ReadFile =~ /^OS Version\/Service Pack\:/) {
#print "$ReadFile\n"
($OSVer)=(split /:/, $ReadFile)[1]; print "$OSVer\n";
&myServerInfo("$OSVer","4");
}
I'm wondering can I use the same method to extract Hostname and IP address for such text cell in VBA
, any help would be appreciated.
In VBA this will put in the cell to the right e.g. if above is in A1, select A1 run this and then in B1,C1,D1 you would have "a01...","10.89...","swnet"
Could change activecell to a range and then loop the above code to replicate for more tahn one line at a time
This gets most of them. It assumes the data are in cell A1 of the active worksheet. It can easily be modified to work on other cells. Let me know if you need that.
Update #1
Based on new information provided in the comments here is a revised version:
Firstly, I want to tell about input data which my code can process perfectly. In your input data, rhythm of "IP Address" and "Hostname" must be equal. I means static serial for those pair as follow:
The input data must be that serial format. Only if in that format,my code will work well. Ok..? I means it can't for following serial input:
So, I made small modification to your input data as follow:
And I modify my code for run that input as follow:
And then I tested my code and I got the following result.
I try what I can for that problem. I can't think for next anymore input data. So, try to adjust input data according to my suggestion. If you can, you can modify my code to meet your requirement. Thanks for asking an challenging question.