Pulling IP Addresses out of log files.

marksman681

New Member
Joined
May 11, 2022
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hello I am having an issue and need some help. I have some SSH log files in excel. Column C is where the data is. There is a lot of text wrapped around the IP address and I want to be able to pull it out into a different column. The text that is around the IP address is random in length. I do not need anything that is missing an octet but if it grabs it I do not care.
 

Attachments

  • Annotation 2022-05-11 162423.jpg
    Annotation 2022-05-11 162423.jpg
    184.7 KB · Views: 40
ok i must be really messing something up. I did what you said and it is all there but now I need to know how to run the macro.

ok still not working and I am not sure what I am doing wrong
also was saved as micro enabled
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You don't call the macro, the formula does that for you. :)
ok well, I am not understanding what I need to do. is there a video or something that will show step-by-step instructions? I am obviously screwing something up
 
Upvote 0
You just use the formula as shown in post#2
 
Upvote 0
here is what I put in and here is what I am getting when I put in the formula. when I put in the formula the OCTET shows up but it is not calculating it properly. I even tried it on a line that had a full IP and it did the same thing.
 

Attachments

  • Screen Shot 2022-05-12 at 12.19.31 PM.png
    Screen Shot 2022-05-12 at 12.19.31 PM.png
    97.5 KB · Views: 6
  • Screen Shot 2022-05-12 at 12.21.14 PM.png
    Screen Shot 2022-05-12 at 12.21.14 PM.png
    136.3 KB · Views: 7
Upvote 0
One way.

Book1 (version 2).xlsb
AB
1ABC 1.1.1.1 QRS1.1.1.1
2DEF 255.255.255.255 TUV255.255.255.255
3GIH 1.28.255.68 XYZ1.28.255.68
Sheet3
Cell Formulas
RangeFormula
B1:B3B1=OCTET(A1)


VBA Code:
Function OCTET(s As String)
With CreateObject("VBScript.RegExp")
    .Pattern = "(?:\d+.?)+"
    OCTET = .Execute(s)(0)
End With
End Function
ok, I have tried this and it is not working. It went from #name? to now #Value? any ideas on what I need to do to fix this? I have 65000 lines that I do not want to go through manual
 

Attachments

  • Screen Shot 2022-05-12 at 12.19.31 PM.png
    Screen Shot 2022-05-12 at 12.19.31 PM.png
    97.5 KB · Views: 5
  • Screen Shot 2022-05-12 at 12.21.14 PM.png
    Screen Shot 2022-05-12 at 12.21.14 PM.png
    136.3 KB · Views: 5
Upvote 0
You are getting that error as you are using a Mac.
 
Upvote 0
well they have the Macros shut off on my work computer so I had to switch to my mac. is there a different formula i need to use for a MAC
 
Upvote 0
As RegEx does not work on a Mac, then you will need a formula if you cannot use macros.
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top