Is there a built-in finction to modify text files

Got a problem you cannot solve? Try here.
Post Reply
tfosorcim
Posts: 10
Joined: Mon Jan 09, 2017 1:25 pm

Is there a built-in finction to modify text files

Post by tfosorcim »

I didnt see something like this (except the INI file editor and the XML file Editor -- and I didnt think these functions could be applied to basic text manipulation since they didnt conform to INI or XML data standards).

If needed, I can script it myself, just didnt know if I was missing something when I searched for it in help in InstallAware.

I'm making modifications to a global.asa (IIS Classic ASP config file) file.

Here's a sample of the text in the global.asa...

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart
Application("APP_DSN") = "DRIVER={SQL Server};database=somedb;server=someserver.somedomain.com;Trusted Connections=Yes;"
Application("APP_LOCATION") = "D:\files"
Application("APP_CONN_TIMEOUT") = 15
Application("APP_CMD_TIMEOUT") = 15
Application("APP_COMPANY_NAME") = "SOMECOMPANY"
Application("APP_COMPANY_INTRANET_URL") = "http://www.somecompany.com"
End Sub

</SCRIPT>



I would want to modify all the bolded data.

Thanks,
Steven
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Is there a built-in finction to modify text files

Post by bokkie »

I'm not sure if this helps or not but I've attached a sample project I cobbled together that might help to some extent. Unzip the file. You'll see an IA project called 11111... You'll also see a text file called TestFile.txt. Copy it to C:\Temp. Change the path in the IA project if you want to put it somewhere else.

Open the 11111... project, build it, run it. It will modify a string in the file which would sort of be like your bolded text you want to replace new values with.

The sample isn't perfect by any means but it might point you in the general direction. I couldn't find anything that'd replace the whole file contents.

Eikkob.
Attachments
tfosorcim sample.7z
(5.46 KiB) Downloaded 648 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
tfosorcim
Posts: 10
Joined: Mon Jan 09, 2017 1:25 pm

Re: Is there a built-in finction to modify text files

Post by tfosorcim »

Many Thanks... Ill look at it when I get back to work Monday (after I install 7zip). :)

Steven
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Is there a built-in finction to modify text files

Post by FrancescoT »

Dear Steven,

you may use the approach described here.
viewtopic.php?f=4&t=9456&hilit=Replace+String

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply