help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

elisp code for replacing every other occurence in a line?


From: Frank Stutzman
Subject: elisp code for replacing every other occurence in a line?
Date: Mon, 12 May 2014 17:32:10 +0000 (UTC)
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/9.2-RELEASE-p3 (amd64))

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]