#!/bin/sh

# this script takes raw hadoop output with a 3-column hitlist (prefix [hex]ip and score)
# sorts it,
# and generates the dotted-quad ip
#
# output is fsdb format

cat "$@" | \
	dbsort ip | \
	dbcolrename ip hex_ip | \
	dbcolcreate ip | \
	dbroweval '_ip = join(".", map {hex} (_hex_ip =~ /(..)(..)(..)(..)/))'
