Archive: how to replace some special word in many files


how to replace some special word in many files
hello,

I need a function to replace some special word with other word in many files.
For example:
replace "$(VERSION)" with "1.0" ,and the word "$(VERSION)" is in many files.It's not easy to change them by hand.:(



Thanks


Take a look at the archive, there are some functions wich should handle this for you, e.g. http://nsis.sourceforge.net/archive/...ances=0,11,122

But evtl. (somebody to verify please!) you shouldn't use {} brackets as place holders. Think this is some kind of special char. Take for example @@VERSION@@ zu search and replace...

Mo


Thank you
But I want to search files in a directory (and subdirectories) and change the content of the searched files(replace special words).Not just replace word in a string.


You can use the following function to find all the files you need:

http://nsis.sourceforge.net/archive/...php?pageid=266

In the callback function, call the text replacement function.


Or this one:

Search File or Directory (Alternative)

Use "about" the same way as the Kichik one...

(I forgot to put it in my signature! Thanks!)


There are many text file manipulation functions here:
http://nsis.sourceforge.net/archive/...instances=0,11

There are two functions to replace text in files:
http://nsis.sourceforge.net/archive/...ances=0,11,311
http://nsis.sourceforge.net/archive/...ances=0,11,311

-Stu


Please, as you (Afrow UK) create much Text Manipulation Pages, create one with the title "Read every byte of a text file" (use "FileRead $var $var2 1", to read each byte), that have a starting and finish point (using FileSeek), the file to read, and to write the result in a string (or in a file if want).

Thanks by the "future help"! :D


great!
I will search some useful functions in nsis archive. :)
Thanks

Richard Xing
http://birdssoft.51.net


Originally posted by deguix
Please, as you (Afrow UK) create much Text Manipulation Pages, create one with the title "Read every byte of a text file" (use "FileRead $var $var2 1", to read each byte), that have a starting and finish point (using FileSeek), the file to read, and to write the result in a string (or in a file if want).

Thanks by the "future help"! :D
I'm not sure how you mean?

-Stu

Hehe. I was just a little enthusiastic above normal (refering to "someone to do a function for me")... Maybe is better do not understand...