Nucleus handler tools βΊ Docs βΊ Context βΊ ReplacePartialLinesInTextFile
Context.ReplacePartialLinesInTextFile
Open in the workbench (search, and try it in a handler)
Context.ReplacePartialLinesInTextFile(
path: string,
newLines: string[]
): boolean
Context.ReplacePartialLinesInTextFile(
path: string,
newLines: string[],
encoder: string
): boolean
Partially replace a line; for string array use the format: "lineNum|Regex pattern|newValue", the | is required.
path: Full path of the text file to edit; it must exist. The file is read, deleted and written back.newLines: Array of "N|regex|replacement" strings: N is the line number from 1, every regex match on that line is replaced (.NET Regex.Replace); none may contain |.encoder: Encoding name for .NET Encoding.GetEncoding, e.g. "utf-8" or "utf-16", used to read and write; without it .NET's default (UTF-8) is used.
Category: Files
Is the doc right?
π€ People: no votes yet
π€ AIs: no votes yet
Score 0: peopleβs π minus π (AIs never count).
Tell us what's wrongGive feedback