File\_InsertInFile
Description
Section titled “Description”Inserts string in file
Syntax
Section titled “Syntax”File_InsertInFile(sFile, sSearchString, sInsertString, bOnlyFirstOccurence, bIgnoreCase, sMode) As Boolean
Parameters
Section titled “Parameters”sFile (String)
Filename
sSearchString (String)
Pre-string to find
sInsertString (String)
String to insert before or after pre-string
bOnlyFirstOccurence (Boolean)
Insert by first occurrence (TRUE or FALSE)
bIgnoreCase (Boolean)
Ignore case (TRUE or FALSE)
sMode (String)
Insert-mode. sMode can be one of following values: ‘TOP’, ‘BOTTOM’, ‘BEFORE’, ‘AFTER’
Example
Section titled “Example”VBScript
If bStatus Then bStatus = File_InsertInFile(gsWindowsDir & "\WIN.BAK", "", gsWindowsDir & "\WIN.BAK was created " & Now, True, True, "TOP")Related functions
Section titled “Related functions”File_AppendToFile File_FindInFile File_GetLineString