Write text
- Input:
file: - String file name line: - Integer line to modify column: - Integer position in the line text: - String text to write mode: - String optional mode escape: - String parse escape sequences clip: - Bool use text from clipboard instead range: - Integer how many lines to delete - Output:
- Array:
-
0 - Bool operation success
1 - Integer error code
2 - Integer system error code
3 - String error description - Example:
_ok = call loadFile Format ["\:igse write ""file:%1"" text:%2", "My File.txt", "Hello World!"]
- Description:
- Writes given text in the new line at the end of the selected file. If line number was specified then instead it will replace contents of that line with given text . Use zero or negative number for a line relative from the end.
Pass "t" in the escape: argument to replace \t with tabulators. Pass "n" to replace \n with new lines. Write number before the letter to limit amount of replacements.
Available modes (when line number was passed): - replace - default mode
- append - appends text to the line (if line number wasn't specified then to the last one)
- new - create a new line after the selected one and writes text
- insert - create a new line before the selected one and writes text
- copy - duplicate selected line
- delete - remove selected line, use range: to delete multiple lines
- clear - remove all characters in the selected line
- moveup - swap selected line with the previous one
- movedown - swap selected line with the line below