Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Great one, I'm happy to have inspired You :).

I used (some of) the code in my project, I hope to publish it soon.

Here's my small script that's using aggregate to, well, aggregate prefixes. That's not perl, I hope it's not a blasphemy here :) . And it actually uses zsh syntax, but it should not be a problem to bashify it.

#!/usr/local/bin/zsh INDEX=1 while [ $INDEX -lt 70000 ] do PREFIXES=`grep "[[:space:]]$INDEX$" example|awk '{print $1}'` if [ $PREFIXES ] then a=`echo $PREFIXES|aggregate` echo $a|awk '{print $1, "\t'$INDEX'"}' let INDEX=$INDEX+1 else let INDEX=$INDEX+1 fi done

For me it crunched ~220000 prefixes to ~120000 so I think it's worth to use it. Not only will the data be smaller but also there will be less lookups (it only aggregates data prefixes of a single AS, so if there are overlapping prefixes with different AS numbers they will be preserved).


In reply to Re: IP prefixes: match IP against "best" network by Fangorn
in thread IP prefixes: match IP against "best" network by shmem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found