Bulk Command Reference
ETWriter includes a command language for transforming text across multiple files. Commands are executed in the order they appear in the command editor. This reference documents the nine supported command types.
Syntax
Each command occupies one line:
COMMAND|ARGUMENT1|ARGUMENT2Arguments are separated by the pipe character (|).
Some commands require only one argument, while others require two.
Command Summary
| Command | Arguments | Action |
|---|---|---|
FIND_APPEND | 2 | Insert a new line after each line containing a match |
FIND_BREAK | 1 | Insert a blank line after each matching line |
FIND_INSERT | 2 | Insert text immediately after every occurrence of a match |
FIND_REPLACE | 2 | Replace every occurrence of matching text |
FIND_DELETE | 1 | Remove every occurrence of matching text |
LINE_APPEND | 2 | Insert a new line after a specified line |
LINE_BREAK | 1 | Insert a blank line after a specified line |
LINE_REPLACE | 2 | Replace a specified line |
LINE_DELETE | 1 | Delete a specified line |
Command names are case-insensitive.
Search operations use literal text matching rather than regular expressions.
FIND_APPEND
Syntax
FIND_APPEND|SEARCH_TEXT|NEW_LINEInserts a new line after each line containing the specified search text.
Example
Command:
FIND_APPEND|TODO|// Follow-up requiredInput:
Complete the feature.
TODO: Review implementation.
Continue testing.Output:
Complete the feature.
TODO: Review implementation.
// Follow-up required
Continue testing.Behavior
The search uses case-sensitive substring matching.
If several lines contain the search text, a new line is inserted after each one.
The original matching lines are retained.
FIND_BREAK
Syntax
FIND_BREAK|SEARCH_TEXTInserts an empty line after every line containing the search text.
Example
Command:
FIND_BREAK|SectionInput:
Section A
Content A
Section B
Content BOutput:
Section A
Content A
Section B
Content BBehavior
The command inserts a new blank line after each matching line.
FIND_INSERT
Syntax
FIND_INSERT|SEARCH_TEXT|INSERT_TEXTInserts text immediately after each occurrence of the matching substring.
Example
Command:
FIND_INSERT|version|_updatedInput:
version=1Output:
version_updated=1Behavior
All occurrences are processed, including multiple matches within the same line.
This operation inserts text within existing lines rather than creating a separate line.
FIND_REPLACE
Syntax
FIND_REPLACE|SEARCH_TEXT|REPLACEMENT_TEXTReplaces every occurrence of the specified search text.
Example
Command:
FIND_REPLACE|localhost|example.comInput:
API_URL=http://localhostOutput:
API_URL=http://example.comBehavior
Replacement is literal and case-sensitive.
All occurrences within every line are replaced.
No regular expression syntax is applied.
FIND_DELETE
Syntax
FIND_DELETE|SEARCH_TEXTDeletes every occurrence of matching text.
Example
Command:
FIND_DELETE|DEBUG:Input:
DEBUG: Starting applicationOutput:
Starting applicationBehavior
The matching substring is removed, but the remainder of the line is preserved.
This command does not delete entire lines containing the search text.
For entire-line deletion, use LINE_DELETE with a line number.
LINE_APPEND
Syntax
LINE_APPEND|LINE_NUMBER|NEW_LINEInserts a new line after the specified line number.
Example
Command:
LINE_APPEND|2|Inserted lineInput:
First line
Second line
Third lineOutput:
First line
Second line
Inserted line
Third lineSpecial Positions
| Number | Behavior |
|---|---|
0 | Insert before the first line |
1 | Insert after the first line |
2 | Insert after the second line |
-1 | Append at the end |
| Greater than line count | Append at the end |
| Other negative values | Insert at the beginning |
LINE_BREAK
Syntax
LINE_BREAK|LINE_NUMBERInserts an empty line after the specified line number.
Example
Command:
LINE_BREAK|1Input:
Heading
DescriptionOutput:
Heading
DescriptionSpecial Positions
LINE_BREAK follows the same insertion-position rules as LINE_APPEND.
For example:
LINE_BREAK|0inserts an empty line before the existing first line.
LINE_REPLACE
Syntax
LINE_REPLACE|LINE_NUMBER|NEW_CONTENTReplaces the entire specified line.
Example
Command:
LINE_REPLACE|2|Updated second lineInput:
First line
Original second line
Third lineOutput:
First line
Updated second line
Third lineSpecial Positions
| Number | Behavior |
|---|---|
0 | Replace the first line |
1 | Replace the first line |
-1 | Replace the last line |
| Positive number | Replace that numbered line |
| Out-of-range number | No change |
Line numbering is otherwise one-based.
LINE_DELETE
Syntax
LINE_DELETE|LINE_NUMBERDeletes the specified line.
Example
Command:
LINE_DELETE|2Input:
First line
Remove this line
Third lineOutput:
First line
Third lineSpecial Positions
| Number | Behavior |
|---|---|
0 | Delete the first line |
1 | Delete the first line |
-1 | Delete the last line |
| Positive number | Delete that numbered line |
| Out-of-range number | No change |
Escape Sequences
ETWriter recognizes selected escape sequences within command arguments.
| Sequence | Interpretation |
|---|---|
\n | Newline |
\t | Tab |
\\ | Backslash |
Example
Command:
FIND_REPLACE|Hello|Hello\nWorldInput:
HelloOutput:
Hello
WorldThe replacement argument contains an actual newline after escape processing.
Important Parsing Rules
Pipe Delimiters
ETWriter separates commands with:
line.split("|")Only the first two arguments are used.
A literal pipe inside an argument is not supported by an escaping mechanism in the supplied parser.
Empty Lines
Blank command lines are ignored.
Whitespace
The parser trims each entire command line.
Whitespace within arguments is otherwise retained.
Literal Matching
The FIND commands use literal string matching and are case-sensitive.
For example:
FIND_DELETE|errordoes not remove uppercase ERROR.
No Regex Matching
The bulk command parser does not interpret search arguments as regular expressions.
For example:
FIND_REPLACE|\d+|numbersearches for the literal characters \d+, after the parser's supported unescaping rules have been applied. It does not match arbitrary numbers.
Command Order Matters
Commands execute sequentially.
For example:
LINE_DELETE|1
LINE_DELETE|1deletes the first line, then deletes the new first line.
Similarly:
FIND_REPLACE|alpha|beta
FIND_REPLACE|beta|gammacan transform alpha into gamma.
Complete Example
Suppose the input is:
Project: Demo
Version: 1
TODO: Review
Status: DraftCommands:
FIND_REPLACE|Version: 1|Version: 2
FIND_APPEND|TODO:|Reminder: Complete review
LINE_DELETE|-1
LINE_APPEND|-1|Status: UpdatedResult:
Project: Demo
Version: 2
TODO: Review
Reminder: Complete review
Status: UpdatedUnsupported Command
The source contains a reference to APPEND_LINE as an alias, but the parser rejects it before alias normalization occurs.
Use the supported command name:
LINE_APPEND|3|New linerather than:
APPEND_LINE|3|New lineSafety Recommendations
- Test transformations on sample files.
- Review command order.
- Avoid empty FIND search strings.
- Preserve original files.
- Verify all generated output.
Warning: An empty search argument may produce unexpected behavior. The implementation does not explicitly reject empty search strings for FIND commands.
Updated 9 days ago
