From owner-freebsd-questions@FreeBSD.ORG Fri Oct 9 09:46:42 2009 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 D8048106566B for ; Fri, 9 Oct 2009 09:46:42 +0000 (UTC) (envelope-from lars@larseighner.com) Received: from mail.team1internet.com (mail.team1internet.com [216.110.13.10]) by mx1.freebsd.org (Postfix) with ESMTP id B74CE8FC0A for ; Fri, 9 Oct 2009 09:46:42 +0000 (UTC) Received: by mail.team1internet.com (Postfix, from userid 12346) id BFE4616B9D2; Fri, 9 Oct 2009 04:46:41 -0500 (CDT) Received: from larseighner.com (unknown [216.110.13.91]) by mail.team1internet.com (Postfix) with SMTP id 51B3D16B9D1; Fri, 9 Oct 2009 04:46:40 -0500 (CDT) Received: by larseighner.com (nbSMTP-1.00) for uid 1001 lars@larseighner.com; Fri, 9 Oct 2009 04:38:03 -0500 (CDT) Date: Fri, 9 Oct 2009 04:38:02 -0500 (CDT) From: Lars Eighner X-X-Sender: lars@debranded.6dollardialup.com To: Gary Kline In-Reply-To: <20091009083516.GA60096@thought.org> Message-ID: <20091009043751.P92438@qroenaqrq.6qbyyneqvnyhc.pbz> References: <20091009083516.GA60096@thought.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Sanitizer: Anomy and SpamAssassin mail filter - see http://www.6dollardialup.com/support/spaminfo.html Cc: FreeBSD Mailing List Subject: Re: for perl wizards. 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, 09 Oct 2009 09:46:42 -0000 On Fri, 9 Oct 2009, Gary Kline wrote: > > Whenever I save a wordpeocessoe file [OOo, say] into a > text file, I get a slew of hex codes to indicate the char to be > used. I'm looking for a perl one-liner or script to translate > hex back into ', ", -- [that's a dash), and so forth. Why does > this fail to trans the hex code to an apostrophe? > > perl -pi.bak -e 's/\xe2\x80\x99/'/g' You're kidding, aren't you? The apostrophe is the same as the single quote, so double quote the execute line. Also, of course, you haven't specified which file(s) to operate on. And finally, there are tons of perl forums, mailing lists, and newsgroups. Pick one to ask perl questions. perl -pi.bak -e "s/\xe2\x80\x99/'/g" OOo > If there any another other tools, I'm interested! check out sed and tr. -- Lars Eighner http://www.larseighner.com/index.html 8800 N IH35 APT 1191 AUSTIN TX 78753-5266