Dear Monks,
I need to have a bunch of IPs from a text file randomized in Perl.
I have the following bogus IPs in the input file:
#Group A 184.75.65.68 #Group B 184.75.122.146 184.75.122.147 184.75.122.148 #Group C 64.3.71.98 64.3.71.99 64.3.71.100 64.3.71.106 #Group D 64.3.73.17 64.3.73.18 64.3.73.19 64.3.73.20 #Group E 66.1.73.21 66.1.73.22 66.1.73.23
I want these IPs randomized by first Class A, then Class-B, then Class-C.
So the output can be something like:
(a random IP from each group, groups should be random as well, but they can repeat until their contents are all exchausted)
184.75.65.68 random from Group A 64.3.71.106 random from Group C 184.75.122.147 random from Group B 64.3.73.17 random from Group D 66.1.73.21 random from Group E random from Group A (obviously nothing since only 1 IP was there) random from Group C random from Group B random from Group D random from Group E and so on
The number of IPs and the number of subnets are not known in the file. They might be in different numbers. Also the IPs in each subnet are not be in equal numbers.
Can some of you experts think of a way? All my attempts have been futile.
I am willing to pay for a solution.
Thanks for your time.
Jenny
In reply to Help with sorting/randomizing? by countingcrows
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |