Edit DAT content (surgical)
edit_dat_contentReplace a substring in a Text or Table DAT's .text. Requires exactly one match unless replace_all is enabled.
Instructions
Surgically replace a substring inside a Text or Table DAT's .text. Without replace_all, requires exactly one match — 0 or >1 occurrences is an error, forcing the caller to add context or set replace_all. Use set_dat_content to overwrite an entire DAT's text in place; use this to make a targeted edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dat_path | Yes | Absolute path to the Text or Table DAT to edit (e.g. '/project1/mytext1'). | |
| old_string | Yes | Exact substring to find. Must match at least once. Empty strings are rejected. | |
| new_string | Yes | Replacement text. May be empty to delete the matched substring. | |
| replace_all | No | When false (default), requires exactly one match — 0 or >1 occurrences is an error. Set true to replace every occurrence. |