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

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

function to increase numbers in a buffer


From: Jordi Burguet Castell
Subject: function to increase numbers in a buffer
Date: Tue, 22 Apr 2003 15:50:14 +0200
User-agent: KNode/0.7.1

Hello,

I am trying to write a function that would work like query-replace-regexp, 
but instead of replacing each match with a fixed string, I want the matched 
numbers to be increased by 3.

Or, easier, I have a file that looks like this:

20      1       23523
20      2       23874
20      3       23898
...

and I want to increase all the numbers in the third column by a certain 
amount, say 3, from (point) to (point-max). A Perl script would not help, 
because I need to do it several times and from different points.

I started following a tutorial in emacs-lisp, and also tried looking at the 
code of some ".el" files, but it seems that I am still far from being able 
to do such a simple(?) function. This post is in case some charitable 
emacs-lisp expert soul knows how to do it.

Thanks,
Jordi


reply via email to

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