Tool to "Find/Replace" variable- or function names ?

Jun 30, 2003 8 Replies

Hi,



I used to use some DOS based program that could Find/Replace over multiple C-source files. One could specify whether it was a variable or function name. It broke under Win3.1 already, and so far I have not found a replacement. AFAICR the executable was called PPT.EXE.



Regards Anton Erasmus


Anton Erasmus wrote in news: snipped-for-privacy@4ax.com:

Borland's CodeWright can do this very easily from within the editor.

- Mark -> --

The editor I use (CodeWright) lets you do this, though it's not smart about limiting substitution to variable and function names. It will prompt you before replacing if you ask it to. It does have a "Whole Word" option so if you want to change (e.g.) "ind" to "idx", you won't get a file full of "widxow"

How about sed? It comes with cygwin...

Or you could try writing your own. Shouldn't be that hard, even if you want to skip comments and string literals.

Regards,

-=Dave

Change is inevitable, progress is not.

UltraEdit

formatting link
is another windows based programmer's editor that can do this. The latest version has a preserve case feature so that "this" is replaced with "that" while "This" is replaced with "That". A single user license is US$35.

Kevin

On Mon, 30 Jun 2003 20:53:14 +0200, Anton Erasmus wrote in comp.arch.embedded:

CodeWright is far and away the best for this, as others have pointed out, but expensive it it's coming out of your pocket and not your company's.

TextPad is a shareware Windows editor that can do this and quite a few other things. IIRC registration is about $30.00.

formatting link

Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq

vim and ctags is a pretty standard and free tool for doing it.

snipped-for-privacy@hotmail.com (Dave Hansen) wrote in news: snipped-for-privacy@News.CIS.DFN.DE:

Actually, v7.5 can restrict to replace within any set of syntax colorable items. E.g. just functions or just keywords or just keywords and user1, etc.

- Mark -> --

H snipped-for-privacy@yahoo.com (Yaakov) wrote in news: snipped-for-privacy@posting.google.com:

My editor can beat up your editor!

- Mark -> --

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required