=pod =head1 NAME B - Convert an integer IP to dotted-decimal notation =head1 SYNOPSIS num2dot [--ip-fields=FIELDS] [--delimiter=C] =head1 DESCRIPTION B is a filter to speedup sorting of IP numbers and yet result in both a C order (i.e., 29.23.1.1 will appear before 192.168.1.1) and readable output (i.e., dotted decimal rather than an integer representation of the IP number). It is designed specifically to deal with the output of B. Its job is to read stdin and convert specified fields (default field 1) separated by a delimiter (default 'B<|>') from an integer number into a dotted decimal IP address. Up to three IP fields can be specified via the B<--ip-fields>=I option. The B<--delimiter> option can be used to specify an alternate delimiter. =head1 OPTIONS Option names may be abbreviated if the abbreviation is unique or is an exact match for an option. A parameter to an option may be specified as B<--arg>=I or S I>, though the first form is required for options that take optional parameters. =over 4 =item B<--ip-fields>=I Column number of the input that should be considered IP numbers. Column numbers start from 1. If not specified, the default is 1. =item B<--delimiter>=I The character that separates the columns of the input. Default is 'B<|>'. =back =head1 EXAMPLE In addition to the default fields of 1-12 produced by B, you also want to prefix each row with an integer form of the destination IP and the start time to make processing by another tool (e.g., a spreadsheet) easier. However, within the default B output fields of 1-12, you want to see dotted-decimal IP addresses. rwfilter ... --pass=stdout | \ rwcut --integer-ip --fields=2,9,1-12 --epoch-time | \ num2dot --ip-field=3,4 The first six columns produced by B will be dIP, sTime, sIP, dIP, sPort, dPort. The --integer-ip switch makes the first, third, and fourth columns be integers, but you only want the first column to be an integer representation. The pipe through B will convert the third and fourth columns to dotted-decimal IP numbers. =head1 SEE ALSO B =cut $SiLK: num2dot.pod 5471 2006-11-01 21:10:02Z mthomas $ Local Variables: mode:text indent-tabs-mode:nil End: