how to do text file manipulation?

suneetha

New member
Joined
Nov 23, 2007
Messages
3
Programming Experience
Beginner
Hai,
First of all I would like to copy a file from another file.Then I would like to open the copied file and read the contents of a file,If i find a particular string I would like to add some content to this file...How to do this?

Suppose my copied file contain this

function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
begin

Dlg_Start:
nResult = 0;

Dlg_SdWelcome:
szTitle = "";
szMsg = "";
//{{IS_SCRIPT_TAG(Dlg_SdWelcome)
nResult = SdWelcome( szTitle, szMsg );
//}}IS_SCRIPT_TAG(Dlg_SdWelcome)
if (nResult = BACK) goto Dlg_Start;

Dlg_SdLicense2:
szTitle = "";
szOpt1 = "";
szOpt2 = "";

end

While reading my file if the string "szTitle" found in the file I would like to add some content to this file..How to do this?
My new file willl contain this


function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szTitle1;

begin

Dlg_Start:
nResult = 0;

Dlg_SdWelcome:
szTitle = "Welcome to the Installshield software";
szMsg = "";
szTitle1="Hello"
//{{IS_SCRIPT_TAG(Dlg_SdWelcome)
nResult = SdWelcome( szTitle, szMsg );
//}}IS_SCRIPT_TAG(Dlg_SdWelcome)
if (nResult = BACK) goto Dlg_Start;

Dlg_SdLicense2:
szTitle = "Welcome to license dialog";
szOpt1 = "";
szOpt2 = "";

end

After finding szTitle(in the first instance) I would like to add this message "Welcome to the Installshield software" and one more line szTitle1="Hello" and "szTitle1" in declaration section of the function.
How to do this?Can any one help me?
 
Back
Top