From owner-freebsd-questions@freebsd.org Tue Nov 7 17:46:21 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 8C20CE5FA79 for ; Tue, 7 Nov 2017 17:46:21 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from oceanview.tundraware.com (oceanview.tundraware.com [45.55.60.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailman.tundraware.com", Issuer "mailman.tundraware.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 511687A900 for ; Tue, 7 Nov 2017 17:46:20 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from [192.168.43.6] (mobile-166-175-58-13.mycingular.net [166.175.58.13]) (authenticated bits=0) by oceanview.tundraware.com (8.15.2/8.15.2) with ESMTPSA id vA7HkBU2074305 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 7 Nov 2017 11:46:14 -0600 (CST) (envelope-from tundra@tundraware.com) Subject: Re: sed - remove nul lines from file To: byrnejb@harte-lyne.ca, freebsd-questions@freebsd.org References: From: Tim Daneliuk Message-ID: Date: Tue, 7 Nov 2017 11:46:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (oceanview.tundraware.com [45.55.60.57]); Tue, 07 Nov 2017 11:46:14 -0600 (CST) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: vA7HkBU2074305 X-TundraWare-MailScanner: Found to be clean X-TundraWare-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=-0.962, required 1, autolearn=not spam, ALL_TRUSTED -1.00, AWL 0.04) X-TundraWare-MailScanner-From: tundra@tundraware.com X-Spam-Status: No 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: Tue, 07 Nov 2017 17:46:21 -0000 On 11/07/2017 11:12 AM, James B. Byrne via freebsd-questions wrote: > > I have a data file created by an ancient proprietary scripting > language called QTP. There is a bug in this program which, on > occasion, manifests itself by inserting output records consisting > entirely of nul (^@) (\x00) bytes at regular intervals. In the > present case every 47th. record consists entirely of nuls. I don't have the magic off the top of my head, but this might be a good job for 'tr'... ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/