From owner-freebsd-questions@freebsd.org Sat Apr 15 17:36:01 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9382DD3F011 for ; Sat, 15 Apr 2017 17:36:01 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCF8F4B for ; Sat, 15 Apr 2017 17:36:01 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id a103so127394773ioj.1 for ; Sat, 15 Apr 2017 10:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject :content-transfer-encoding; bh=WrjY/mYBSJ4OKcbm/IRjkpHLkzCcxvcOmS79E6/Fg8o=; b=ipgQd86QEMe2RwnM43rI+owwkyCYtL7OdnEDccGyB956ivpiu+UEir7xCsn3Kzv008 aPI/LFfMRqo3Ki0TGTGmapkt4phtuKjtbUgiURVNbLAetnoZLaGkozc4hKnT+Za+np/D zxyOauUa4Urj68VmgJHEhhMdvPPPNCBBsAyoJ6lzkHGhlvjw2ZpUoiLidz6SaxmiwaR1 1eMCX1ONM2XeS+WvsJtXXRk4B5W+FI0cO1aDG3P5GpE7tT2qxusumbqsNfojZvslRWFl XbYjcHVw4I1SpbvegbcOcCxC9L/uOabK1pLSxkImj4sjmyDEz73tJa2hzrqkcNG9wQVX J6UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-transfer-encoding; bh=WrjY/mYBSJ4OKcbm/IRjkpHLkzCcxvcOmS79E6/Fg8o=; b=CX1U52k4TLQRbw3IKxjCjm4QW9J0c8n9Xrbbdc+qGXpwmV+5Ebywo1AqowaSMYQvvp YBjm2GAn9swYspgNTRnX6HPDD62sLbzvp0uWvfDTrrU19YqXVwV0jMNMrPrk5hwLSehE CnsaZesgZG9o1ixg5/4falqjg7fnsH3aMjO4LUq/4cKUYDVbOxwGCky8nqWVWlO5seQq gibHGSnljh1uMjBVhv83Pk9qPz7AbJSrsC1dsgTseoFANJ/jlk5jVj5KtdTpu7sLP6Pu AsefzPLIrwVU66kJBCw3/mDqS+78PsTQkPZRwgCuqtLXAf1ctrILJCvH5iTnWjlJbCVQ FBxQ== X-Gm-Message-State: AN3rC/7jDDkOnHXG6wzPbgcpvSbkBMHt13Avs6GAfdxXc4OhUVjPG/4t zDDEy5bY+8ZruSrw X-Received: by 10.107.20.199 with SMTP id 190mr2808132iou.81.1492277760678; Sat, 15 Apr 2017 10:36:00 -0700 (PDT) Received: from [10.0.10.3] (cpe-74-141-88-57.neo.res.rr.com. [74.141.88.57]) by smtp.googlemail.com with ESMTPSA id f196sm2995037itc.2.2017.04.15.10.35.59 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Apr 2017 10:36:00 -0700 (PDT) Message-ID: <58F25A01.1060208@gmail.com> Date: Sat, 15 Apr 2017 13:36:01 -0400 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: FreeBSD questions Subject: awk help Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:36:01 -0000 Hello list; Can not figure how to process 2 lines as a single line. I have this file. poollist: opts = 0x2 Name: test Role: ipf References: 2 Hits: 0 Nodes Starting at 0xc9fd4800 Address: 1.11.244.65/32 Hits 0 Bytes 0 Name Ref 2 Address: 1.163.113.139/32 Hits 0 Bytes 0 Name Ref 2 Address: 1.163.139.214/32 Hits 0 Bytes 0 Name Ref 2 Address: 1.173.51.202/32 Hits 0 Bytes 0 Name Ref 2 Address: 1.175.164.129/32 Hits 0 Bytes 0 Name Ref 2 Address: 99.197.14.34/32 Hits 0 Bytes 0 Name Ref 2 The Address line and the Hits line makes a pair. For any pair that hits is greater than zero output file with ip address with ; sufix instead of /32 and hit value in fixed position. I can't figure out how to code awk to process the 2 lines as a pair. All ready searched the online awk references and could not find an example. Any pointers would sure help. Thanks