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: How to update a particular string value in a file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Jul 11, 2012
08:45 AM
How to update a particular string value in a file
Hi all,
I need to check a particular string value in a file and then update that string value as per my requirement.
For Example:
In a file, sample=0 is there, Now i want to search for sample value and if it's value is zero then i want to change that value to 1.
Please let me know the functions useful for implementing this.
Regards,
Sai
I need to check a particular string value in a file and then update that string value as per my requirement.
For Example:
In a file, sample=0 is there, Now i want to search for sample value and if it's value is zero then i want to change that value to 1.
Please let me know the functions useful for implementing this.
Regards,
Sai
(1) Reply
Jul 17, 2012
11:45 AM
Is there a header like [Blabla]?
Then it looks like an INI file to me, for which you have some built-in functions:
GetProfString ( szFileName, szSectionName, szKeyName, svResult );
WriteProfString ( szFileName, szSectionName, szKeyName, szValue );
szFileName:your file
szSectionName: Blabla if the header is [Blabla]
szKeyName: sample
Then it looks like an INI file to me, for which you have some built-in functions:
GetProfString ( szFileName, szSectionName, szKeyName, svResult );
WriteProfString ( szFileName, szSectionName, szKeyName, szValue );
szFileName:your file
szSectionName: Blabla if the header is [Blabla]
szKeyName: sample