From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.help Subject: Re: how to manipulate data like awk or perl when visiting a file Date: Tue, 30 Dec 2008 08:57:48 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86ocytaexf.fsf@lifelogs.com> References: <50783260-3503-4714-b7f6-96d56b020a46@f40g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230651648 18617 80.91.229.12 (30 Dec 2008 15:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2008 15:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 30 16:41:54 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LHgj6-0006Zd-E6 for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 16:41:48 +0100 Original-Received: from localhost ([127.0.0.1]:48402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHghs-0008PQ-SU for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 10:40:32 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news.musoftware.de!wum.musoftware.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-X-Trace: news.albasani.net svdgYk7YMpUsdu+QcyqnE07s0YR32qhWL17vcUMLtNwDpTsc0VXQ4M1xlqB898kEJko6JA5FEBAZrG1xi1ht61c3BDoLYzqs/axB6UeHk7Gbpvw35vTOF953PGRUwUZx Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Tue, 30 Dec 2008 14:57:28 +0000 (UTC) X-User-ID: uL0Fzzro0jx80dEQfVXKS9pehFt0sSeQnG8UfRupKFs= X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:9wXV/vguV1Kpx4VJBr6MuCyrreQ= sha1:3rC9iB42pITg6wsyszYEDBv/Tu4= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) X-NNTP-Posting-Host: RxiBJh14MyYq3qYDcitJWw62gLZlg96mDHGoQrQ1qrM= Original-Xref: news.stanford.edu gnu.emacs.help:165644 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60976 Archived-At: On Tue, 30 Dec 2008 00:59:28 -0600 Harry Putnam wrote: HP> I got pretty interested reading [Xah's] comparison of perl vs elisp. HP> What prompted my question here was that I had no access to shell tools HP> or perl on a specific machine I was on right then, so it got me to HP> thinking why I never see much mention of using elisp for those kinds HP> of jobs. HP> Its an interesting subject but in fact I'm rarely in that situation HP> so usually rely on shell tools awk and perl. Those I have some small HP> grasp of. The biggest problem with ELisp file processing vs. Perl/awk/etc. is that efficient line-by-line processing is not possible. Thus you're limited to either byte offsets or what will fit in a buffer. This is a big inconvenience for large files. Also, concise one-liners are trivial with Perl and awk, while Emacs one-liners are painfully verbose (with the one saving grace that $ doesn't show up much in ELisp code). By the time you're on the third screen line, you've forgotten what you needed in the first place. Ted