#!/usr/bin/awk --exec BEGIN { for( ARGC=1; ARGC<17; ARGC++ ) { ARGV[ARGC] = "ve" sprintf("%X",ARGC - 1) "/PUBLIC_ID.txt"; } } BEGINFILE { boot_key = ""; boot_port = ""; boot_ip = ""; boot_tcp = ""; } { if ( boot_key == "" ) boot_key=$0; else if( boot_port == "" && $1 == "Port:" ) boot_port=$2; else if( boot_ip == "" && $1 == "IP:" ) boot_ip=$2; else if( boot_tcp == "" && $1 == "TCP:" ) boot_tcp=$2; } ENDFILE { print( boot_key "@" boot_ip ":" boot_port "{tcp:" boot_tcp "}" ); }