AppendFile Use Examples
Basic AppendFile Use
This is an example that we first check if the file exists in the directory. If it does, we append the text to the original file. If it doesn’t, we create a new file.
For testing, TextAttach.txt already exists. The text in AppendFile will be written at the end of original text.
If in AppendFile, we set InsertNewLine to ‘Before’, new text will be added in a new line. This is useful if you want to use ReadFile and ReadAllLines later.
If the file doesn’t exists, AppendFile will throw the following error.