hustxy
22nd October 2003 10:52 UTC
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
Mosestycoon
22nd October 2003 11:32 UTC
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
hustxy
24th October 2003 03:01 UTC
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.
kichik
24th October 2003 14:22 UTC
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.
deguix
24th October 2003 21:09 UTC
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!)
deguix
25th October 2003 21:24 UTC
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
hustxy
27th October 2003 01:35 UTC
great!
I will search some useful functions in nsis archive. :)
Thanks
Richard Xing
http://birdssoft.51.net
Afrow UK
27th October 2003 14:35 UTC
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
deguix
27th October 2003 21:51 UTC
Hehe. I was just a little enthusiastic above normal (refering to "someone to do a function for me")... Maybe is better do not understand...