This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Text substitution question
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 04, 2008
03:41 PM
Text substitution question
Hello all!
I am trying to edit three text files during an installation.
I've been trying to use the TextSub commands without success:
szFileName = TARGETDIR ^ "config\\server\\conmgr.properties";
szSearchStr = "";
TextSubSetValue ( "", TARGETDIR, FALSE );
nResult = FileGrep ( szFileName, szSearchStr, svReturnLine, nvLineNumber, RESTART );
while (nResult != END_OF_FILE)
endwhile;
Can anyone point out how to make this work, or another way of stepping through a text file and replacing all instances of a tag?
I'll greatly appreciate any help with this! Thank you! 😄
- Rick
I am trying to edit three text files during an installation.
I've been trying to use the TextSub commands without success:
szFileName = TARGETDIR ^ "config\\server\\conmgr.properties";
szSearchStr = "
TextSubSetValue ( "
nResult = FileGrep ( szFileName, szSearchStr, svReturnLine, nvLineNumber, RESTART );
while (nResult != END_OF_FILE)
TextSubSubstitute ( svReturnLine, FALSE );
nResult = FileGrep (szFileName, szSearchStr, svReturnLine, nvLineNumber, CONTINUE);
endwhile;
Can anyone point out how to make this work, or another way of stepping through a text file and replacing all instances of a tag?
I'll greatly appreciate any help with this! Thank you! 😄
- Rick
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 05, 2008
06:59 PM
Well, in case some other poor slob comes upon this thread looking for the answer to this, I resolved it by doing the following instead:
while (nResult != END_OF_FILE)
endwhile;
while (nResult != END_OF_FILE)
StrReplace ( svReturnLine, szSearchStr, TARGETDIR, 0 );
FileInsertLine (szFileName, svReturnLine, nvLineNumber, REPLACE);
// Search again.
nResult = FileGrep (szFileName, szSearchStr, svReturnLine, nvLineNumber, CONTINUE);
endwhile;