Escribal
Back to Docs

Text file

Editing

This group writes into a plain-text file: adding text and lines, inserting, replacing or deleting a line, and replacing a text everywhere it appears. A .txt has no formatting, no styles and no structure — it is a sequence of lines, and that is the unit these instructions work with.

Prerequisite: the workflow must already have a text file created or opened (with Create txt file or Open txt file).

These concepts recur across several instructions in this group; they are explained here once.

  • Document: indicates which document in the workflow the instruction applies to. If left empty, the current document is used. If the document doesn’t exist, the instruction simply does nothing.

  • Line number: lines count from 1, and -1 means the last line. A line that doesn’t exist (0, or a number past the end) is not an error: the instruction simply does nothing.

  • Empty text does nothing: an instruction that writes text with the text field empty is a no-op. To remove a line use Delete Line.

  • Line endings are kept: if the file already uses Windows line endings, new lines use them too.

  • Dynamic values (@name): in any text field you can type @ followed by the name of a value saved earlier in the workflow, and it will be replaced by that value. @@ writes a literal @.

  • “From variable” fields: the @name trick only works in text fields. The numeric field (Line number) and the yes/no field (Case sensitive) each have a companion “from variable” field:

    • If you leave it empty, the value chosen in the normal field is used.
    • If you fill it in with the name of a saved value, the engine ignores the normal field and reads the value from that variable.

    This is mainly for chaining instructions. If you only work with fixed values, you can ignore these fields.

Append Line .txt

Adds text as a line of its own at the end of the file.

When to use it: the usual way to build a text file — one record, one line.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Text Text of the new line. Supports @name (empty) Yes

Important behavior: if Text is empty, nothing happens. If the file was left in the middle of a line (by Append Text), that line is closed first, so the new text always starts on its own line.


Append Text .txt

Adds text at the end, without starting a new line.

When to use it: to build a line piece by piece, or to add a word to what is already written.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Text Text to add. Supports @name (empty) Yes

Important behavior: if Text is empty, nothing happens. The text goes in exactly as written: no line break is added before or after it.


Delete Line .txt

Removes a line from the file.

When to use it: to drop a header row, or a line that a previous instruction found.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Line number Line to delete, counting from 1. -1 = the last line 1 No
Line number (from variable) Reads the line number from a saved value (empty) No

Important behavior: a line that doesn’t exist does nothing. Deleting the only line leaves the file empty, which is allowed.


Insert Line At .txt

Inserts a new line at a position, pushing the rest down.

When to use it: to put a heading or a title at the top of a file that already has content.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Line number Line to insert before, counting from 1. -1 = at the end 1 No
Text Text of the new line. Supports @name (empty) Yes
Line number (from variable) Reads the line number from a saved value (empty) No

Important behavior: if Text is empty, nothing happens. -1 adds the line at the end; a line number that doesn’t exist (0, or past the last line) does nothing.


Replace Line .txt

Replaces the content of one line, leaving the rest of the file untouched.

When to use it: to update a header line or a total that was written earlier in the workflow.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Line number Line to replace, counting from 1. -1 = the last line 1 No
Text New content of the line. Supports @name (empty) Yes
Line number (from variable) Reads the line number from a saved value (empty) No

Important behavior: if Text is empty, nothing happens — an empty line is not written this way. A line that doesn’t exist does nothing.


Replace Text .txt

Replaces every occurrence of a text in the whole file.

When to use it: to fill in placeholders — write the file with markers and replace them with values gathered later.

Parameter Meaning Default Required
Document Document the instruction applies to (current document) No
Search text Text to look for. Supports @name (empty) Yes
Replace with Text to put in its place. Supports @name (empty) No
Case sensitive Yes = Cat and cat are different No No
Case sensitive (from variable) Reads yes/no from a saved value (empty) No
Save count key Name to save how many were replaced under (empty) No

Important behavior: if Search text is empty, nothing happens and nothing is saved. Replace with can be empty: that erases the found text. The search is plain text, not a pattern.


This documentation is the help of the application, and it comes underCreative Commons Attribution 4.0.