Monday, July 16, 2018

#1 2017-11-25 08:22:34 am

Registered: 2011-08-22
Posts: 80

CIDR to subnetmask text converter

I can’t even get started on this script. yikes I hope someone can help me get started.

The files I personally need to be converted don’t use /32 for individual listings, instead just list the main ip address. Thus to make this a universal script for anybody to use it should use two approaches to cater for the suggested scenario.

1. Lines of the document that do not contain “/“ add “/” to EOL is my thought of how to approach it.
2. All others would be replacements for their subnetmask equivalents such as:
“/32“ to “/”
“/31“ to “/”
“/30“ to “/”
“/29“ to “/”
“/28“ to “/”
“/27“ to “/”

The files needing conversion are between 1,800 up to half a million listings. Not a practical thing to do manually. big_smile
My particular purpose is for block-lists to block out net BOTs.

Model: MacPro 2008 (3,1)
AppleScript: 2.8.1 (183.1)
Browser: Firefox 57.0
Operating System: Mac OS X (10.11.6)

The shy can light the dull dark room rich with life when their eyes mirror their inner sunrise



#2 2017-11-27 02:56:37 pm

From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 264

Re: CIDR to subnetmask text converter

I'm afraid I'm not fully understanding what the input and output files would look like, and if other people are having the same problem, that could be why you don't have any answers yet.

Could you give us an example or two of (truncated) input files and what the corresponding output file would look like?

Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)