From owner-freebsd-questions@FreeBSD.ORG Fri Sep 5 14:39:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572561065681 for ; Fri, 5 Sep 2008 14:39:06 +0000 (UTC) (envelope-from mkbucc@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id 126998FC29 for ; Fri, 5 Sep 2008 14:39:05 +0000 (UTC) (envelope-from mkbucc@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so268103yxb.13 for ; Fri, 05 Sep 2008 07:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=MFsaNYV89VXV1vgsnKX/xZBoJfwVm+nfpeZRbMlcMSI=; b=ZO6N54Fnw3rNOR+eOLkCXDorh5PemEMpHAuOC8aYIGcb9fVImCiTSRlVv6ZoyFiuEg deev5blStIBbDkMjlYpwc4eUQXrlKAqUCFFcFcN644COi538WgO4ae9HEtwwdvhLaJLO Pp1mJl9SQo8DsUY7tmby8eLhBzBzB5ZAg1TOI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=xIgA4voBILteCXJojsaPQYGJi5YjmbNG/0B+/nZoL/I20OxfjVAK1sFj8cXUEl8IRn KfHFjZ59GpnD0BnwWD06sV6hpQgoPAsacurqrJL/StDnCHT09aO5EHW14aUAbf6YNbOL a8isRtLfD/67Z6ORSs7kzPBQT/AG/WnFZ2vI8= Received: by 10.114.148.1 with SMTP id v1mr10104444wad.21.1220624048680; Fri, 05 Sep 2008 07:14:08 -0700 (PDT) Received: by 10.114.53.8 with HTTP; Fri, 5 Sep 2008 07:14:08 -0700 (PDT) Message-ID: <59f4cb420809050714i16ebe30bmd9f325592f05516e@mail.gmail.com> Date: Fri, 5 Sep 2008 10:14:08 -0400 From: "Mark B." To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: How to delete non-ASCII chars in file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 14:39:06 -0000 I have a text file that includes some non-ASCII characters For example, opening the file in vi shows lines like this: 'easth_0.541716776378' 0 \xe2\x80\x98dire' 2 Is there a command-line tool I can use to delete these characters? I tried: cat f | tr -cd [:print:] but this removes the newlines. I also tried cat f | sed "s/[^:print:]//g" but it didn't remove the characters. Thanks, m