Archive: edit line in text file and replace with text by user


edit line in text file and replace with text by user
Hey guys,
Is there any function or script for this thing:
I wanted to script a small installer, which asks the user to enter any word, which will be placed into a specific txt file into a certain line.

E. g. there's a test.txt, which includes the line "name test". The user starts the installer and it gives you an edit box, where you can put a word or text, what ever you want. Lets say it would be "newname". Then press Ok or next button and if you check the test.txt again, it should contain "name newname".

Can someone help me or is it possible?

Thx for all your help in advance!


http://nsis.sourceforge.net/Category...tion_Functions


I already hat a look at these functions, but none of them could provide a function like an "edit box" in which the user can type his information.


To add an edit box, you can use InstallOptions or nsDialogs. Both have examples in the Examples folder.

To replace a line in a file, you can use one of the functions Yathosho posted, or LineFind.