From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Grant Rettke Newsgroups: gmane.emacs.help Subject: Re: elisp code for replacing every other occurence in a line? Date: Mon, 12 May 2014 12:41:21 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1399916503 15863 80.91.229.3 (12 May 2014 17:41:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2014 17:41:43 +0000 (UTC) Cc: Emacs Help To: Frank Stutzman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 12 19:41:38 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjuEI-00050i-Hr for geh-help-gnu-emacs@m.gmane.org; Mon, 12 May 2014 19:41:34 +0200 Original-Received: from localhost ([::1]:39106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjuEI-0003mo-2O for geh-help-gnu-emacs@m.gmane.org; Mon, 12 May 2014 13:41:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjuE7-0003mS-7K for help-gnu-emacs@gnu.org; Mon, 12 May 2014 13:41:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjuE6-00031C-7c for help-gnu-emacs@gnu.org; Mon, 12 May 2014 13:41:23 -0400 Original-Received: from mail-oa0-x232.google.com ([2607:f8b0:4003:c02::232]:61172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjuE6-000311-3e for help-gnu-emacs@gnu.org; Mon, 12 May 2014 13:41:22 -0400 Original-Received: by mail-oa0-f50.google.com with SMTP id i7so8600363oag.23 for ; Mon, 12 May 2014 10:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fyklwmVRC8Zpl9a5hYhYJSlAsc9C0fEiNYtHp3xNjdc=; b=R/INnmZbcjil/0Tt6uXSM3eosMCxo8yYBH5K8qJAwtHciMm1TzoijtU/z81tWJC/F9 OGdUXbtipdny+WqJ1xWs/ltClrUnCuiP49hGrSFvsyBQvKf8tTBie1sV03sIqOF3aqiH 7TCPIfBuqNMcGvtQb2HN75JMNLM8XJhqT1IKxiVY/TbkCDxm8TZe37ZFw98VE/x6sCFq dbsFECSUfDLFAC3Egoyu96kf6wzbD65qJm6Fk6e3VtH7l12i7AHQs1e6VSrRzjIsKXNz HNGr+zJQqfMKNukEyQfleQqx6IL2vp8IRmQGdg1ES084fYClmFmIn8Zl6gMNA4U8SGR2 6vug== X-Received: by 10.60.74.195 with SMTP id w3mr36346564oev.28.1399916481298; Mon, 12 May 2014 10:41:21 -0700 (PDT) Original-Received: by 10.182.50.135 with HTTP; Mon, 12 May 2014 10:41:21 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: vHvSth-DMSbcvnU2qwL_6_2_8Bc X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97613 Archived-At: What is the first simple case you want to handle that you would define as successful? May you post 3-5 sample tests of how you want it to work and would know that it is working correctly? Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi grettke@acm.org | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson On Mon, May 12, 2014 at 12:32 PM, Frank Stutzman w= rote: > This is probably trivial for emacs-masters, but I'm not one and > the solution is escaping me... > > Say I have a buffer that have intermittant lines that look like: > > a,b,c,DD,e,f,g,DD,h > i,j,k,DD,l,m,n,DD,o > > I'm trying to write some lisp code that will change them so that > they look like: > > a,b,c,DD,e,f,g,YY,h > i,j,k,DD,l,m,n,ZZ,o > > DD,YY and ZZ will always be the same strings. These pairs of lines > may not always be found sequentially in the file. For what its worth, > this buffer is a CSV delimited buffer although I would prefer to do this > without using any special mdoes. > > -- > Frank Stutzman > >