Zer0Velocity Posted January 14, 2014 Share Posted January 14, 2014 Hey all, I have a IP range list which I would like to output the possible IP's in the range to another text. I'm hoping someone can help me. Example of first 2 IP ranges in the text file. 109.104.32-63.0-255 109.109.0-31.0-255 Link to comment Share on other sites More sharing options...
michaelslamet Posted January 14, 2014 Share Posted January 14, 2014 What is the input and what is the output? Please post example Link to comment Share on other sites More sharing options...
water Posted January 14, 2014 Share Posted January 14, 2014 You mean 109.104.32-63.0-255 should become 109.104.32.0 ... 109.104.32.255 ... 109.104.33.0 ... 109.104.33.255 ... ... 109.104.63.255 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted January 14, 2014 Share Posted January 14, 2014 Something like this? expandcollapse popupGlobal $sIP = "109.104.32-63.0-255" Global $aiIP = StringSplit($sIP, ".") Global $aiIP1 = StringSplit($aiIP[1], "-") If @error Then $iEnd1 = $aiIP1[1] Else $iEnd1 = $aiIP1[2] EndIf $iStart1 = $aiIP1[1] Global $aiIP2 = StringSplit($aiIP[2], "-") If @error Then $iEnd2 = $aiIP2[1] Else $iEnd2 = $aiIP2[2] EndIf $iStart2 = $aiIP2[1] Global $aiIP3 = StringSplit($aiIP[3], "-") If @error Then $iEnd3 = $aiIP3[1] Else $iEnd3 = $aiIP3[2] EndIf $iStart3 = $aiIP3[1] Global $aiIP4 = StringSplit($aiIP[4], "-") If @error Then $iEnd4 = $aiIP4[1] Else $iEnd4 = $aiIP4[2] EndIf $iStart4 = $aiIP4[1] For $iIndex1 = $iStart1 To $iEnd1 For $iIndex2 = $iStart2 To $iEnd2 For $iIndex3 = $iStart3 To $iEnd3 For $iIndex4 = $iStart4 To $iEnd4 ConsoleWrite($iIndex1 & "." & $iIndex2 & "." & $iIndex3 & "." & $iIndex4 & @LF) Next Next Next Next Results in 109.104.32.0 109.104.32.1 109.104.32.2 ... 109.104.32.255 109.104.33.0 ... 109.104.33.255 ... 109.104.63.255 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Gianni Posted January 14, 2014 Share Posted January 14, 2014 I wrote a general purpose >multiping utility/udf that, among other things, it can also generate a list of IP starting from ranges passed in the the shape that you're asking. (but not only) Here an example: #include <multiping.au3> #include <array.au3> $MyRange = _GetIpAddressList("109.104.32-63.0-255") _ArrayDisplay($MyRange) >here you can find Multiping.au3 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Zer0Velocity Posted January 14, 2014 Author Share Posted January 14, 2014 I wrote a general purpose >multiping utility/udf that, among other things, it can also generate a list of IP starting from ranges passed in the the shape that you're asking. (but not only) Here an example: #include <multiping.au3> #include <array.au3> $MyRange = _GetIpAddressList("109.104.32-63.0-255") _ArrayDisplay($MyRange) >here you can find Multiping.au3 I just tested the udf and so far it seems to be working brill. Thank you for pointing me to this. And thank you all for helping Link to comment Share on other sites More sharing options...
Gianni Posted January 14, 2014 Share Posted January 14, 2014 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now