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
- :
- Re: Modify text in several files
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Mar 20, 2015
08:21 AM
Modify text in several files
I am wondering if it is possible to just replace part of a string using the text file replacement. We have several .config files that include a value '${TEMP}\SomeFileName.log'. I want to just replace the '${TEMP}\' value with '[INSTALLDIR]' at install time. However, it seems like the search pattern is for the entire string.
[CODE]
e.g., Find What: --> Replace With: [/CODE]
Is there a better way for doing this so that I do not have to identify every .config file and create a new search pattern for each one?
Thank you.
[CODE]
e.g., Find What:
Is there a better way for doing this so that I do not have to identify every .config file and create a new search pattern for each one?
Thank you.
- Tags:
- msi
- text file changes
(4) Replies
‎Mar 20, 2015
08:47 AM
I'm not quite clear what the difficulty you're facing here is; it seems like from what you describe you should be able to search for ${TEMP}\ and replace with [INSTALLDIR] like you say doesn't work. Reading between the lines, do you only want to do this if "${TEMP}\" is followed by certain text that differs in each file you're searching? Like you indicate, I believe that would require separate search patterns for each different suffix.
Alternately, is the problem due to including what looks like the entire element in your search, i.e. could you instead search for? While this does feel weird, if you control the starting state of the file well enough, it may work in practice.
Alternately, is the problem due to including what looks like the entire element in your search, i.e. could you instead search for
‎Mar 20, 2015
09:25 AM
Michael,
Correct, if I simply try to find ${TEMP}\ and replace with [INSTALLDIR] then nothing is changed. Note that I do not have the option for whole word selected in my test. If I include the whole line then the replace works.
All of the examples in the help seem to indicate the need for a whole line as well.
I will try the pattern you suggested to see what happens.
Correct, if I simply try to find ${TEMP}\ and replace with [INSTALLDIR] then nothing is changed. Note that I do not have the option for whole word selected in my test. If I include the whole line then the replace works.
All of the examples in the help seem to indicate the need for a whole line as well.
I will try the pattern you suggested to see what happens.
‎Mar 20, 2015
09:50 AM
I have to apologize. My memory on this behavior was wrong and I just figured out why.
Some of the files contain UNIX style directory notation, e.g.
For files with standard windows notation the replace works correctly with just the find value "${TEMP}\".
I had worked on these back in the spring and my memory is lacking as to why I chose to find and replace a whole string. The only thing I can think of is that I typed something wrong in my earlier tests.
Some of the files contain UNIX style directory notation, e.g.
For files with standard windows notation the replace works correctly with just the find value "${TEMP}\".
I had worked on these back in the spring and my memory is lacking as to why I chose to find and replace a whole string. The only thing I can think of is that I typed something wrong in my earlier tests.