File_DeleteLineInFile
Description
Section titled “Description”Deletes line in specified file
Syntax
Section titled “Syntax”File_DeleteLineInFile(sFile, sSearchString, bOnlyFirstOccurrence, bIgnoreCase) As Boolean
Parameters
Section titled “Parameters”sFile (String)
Section titled “sFile (String)”Filename
sSearchString (String)
Section titled “sSearchString (String)”String to be searched for
bOnlyFirstOccurrence (Boolean)
Section titled “bOnlyFirstOccurrence (Boolean)”Delete only first occurrence
bIgnoreCase (Boolean)
Section titled “bIgnoreCase (Boolean)”Ignore case
Remarks
Section titled “Remarks”- The whole line is deleted when it contains sSearchString anywhere in the line.
- The file must exist. If it doesn’t, the function returns False.
- The file keeps its attributes, such as read-only.
- The file is read and written as ANSI text. See Text file encoding.
Example
Section titled “Example”If bStatus Then bStatus = File_DeleteLineInFile("C:\CapaInstaller.txt", "CapaInstaller", True, True)Related functions
Section titled “Related functions”File_AppendToFile File_FindInFile File_InsertInFile Constants Package Property Variables