Bulk File Processing
Bulk mode allows ETWriter to apply a sequence of text transformation commands across multiple eligible files in a directory. It is intended for repetitive editing tasks that would otherwise require opening and modifying files individually.
What Can Bulk Mode Do?
Bulk mode supports:
- Text search and replacement
- Text deletion
- Text insertion after matches
- Line insertion after matching lines
- Blank-line insertion
- Line replacement
- Line deletion
- Position-based line insertion
The operations are expressed using a command language documented in the Bulk Command Reference.
Basic Workflow
- Select Bulk from the mode selector.
- Click Open to select a source directory.
- Enter the bulk commands.
- Specify an Output Folder name.
- Click Run.
- Select a destination directory if prompted.
- Review the completion status and resulting files.
Example: Replace Text Across Files
Suppose several source files contain:
version=1You want to replace the value with:
version=2Enter:
FIND_REPLACE|version=1|version=2Select the source directory, specify the output folder name, and run the operation.
ETWriter processes eligible text files and writes the transformed content to the generated output.
Bulk Command Format
Commands use a pipe-delimited structure:
COMMAND|ARGUMENT1|ARGUMENT2Some commands require only one argument:
FIND_DELETE|unwantedOther commands require two:
FIND_REPLACE|old|newEnter one command per line.
Command Execution Order
ETWriter parses the command list and executes commands sequentially.
This means the output of one command becomes the input of the next.
For example:
FIND_REPLACE|old|new
FIND_APPEND|new|// UpdatedThe second command operates on the text after the first replacement has occurred.
Command order can therefore change the final results.
Supported File Types
Bulk mode processes text files with the following extensions:
| Category | Extensions |
|---|---|
| Text and Documentation | txt, md |
| Web Development | js, ts, jsx, tsx, html, css, scss |
| Structured Data | json, xml, yml, yaml, csv |
| Configuration | ini, conf |
| Programming | py, rb, go, rs, c, h, cpp, hpp, java, sh |
The filename extension is not the only check.
ETWriter also examines the first portion of each file for NUL bytes. A file containing a NUL byte in that sample is excluded from text processing.
Files That Are Skipped
Bulk mode excludes unsupported extensions and files that fail its basic text-content check.
Examples include:
- Images
- Videos
- Audio files
- PDF and word-processing documents
- ZIP and other archives
- Executable or binary files with unsupported extensions
The filtering behavior is intentionally conservative.
Directory Processing
When supported browser APIs are available, ETWriter traverses the selected source directory and its subdirectories.
It creates corresponding output directories and writes eligible transformed text files.
Relative paths are preserved.
Example source:
project/
├── index.html
├── styles.css
└── scripts/
└── app.jsExample output:
edited-output/
├── index.html
├── styles.css
└── scripts/
└── app.jsUnsupported files are not copied into the output.
Direct Directory Output
When the File System Access API is available, ETWriter asks you to choose a destination directory.
It then creates the named output folder within that destination.
For example:
Destination directory/
└── edited-output/
└── processed filesSource and Destination Protection
ETWriter checks whether the destination directory is the same directory as the source.
If they are the same, the operation is rejected.
It also skips traversing a directory whose name matches the configured output folder name.
Caution: The application does not provide a complete transactional rollback mechanism. Choose a distinct destination and back up important files before processing.
ZIP Fallback
If direct directory access is unavailable, ETWriter uses an alternative workflow:
- Select a folder using the browser's directory-upload capability.
- Enter the bulk commands.
- Specify an output folder name.
- Click Run.
- Download the generated ZIP archive.
For example:
edited-output.zipThe archive contains the processed files beneath a folder corresponding to the specified output name.
ZIP generation uses JSZip.
Output Status
ETWriter displays status messages indicating whether processing is running, completed, or failed.
The direct-write mode reports a count of files written.
ZIP fallback mode reports the generated archive name.
Important Limitations
Text Only
Bulk mode is intended for files that can be treated as UTF-8 text.
Binary documents and unsupported extensions are skipped.
Line Endings
The command processor splits text into lines and joins them using the newline character (\n).
This means existing CRLF line endings may be normalized to LF.
Encoding
Input is decoded through the browser's text decoder, and output is written as text.
Non-UTF-8 content may not be preserved correctly.
Output Collisions
If the chosen output directory already contains files with the same relative paths, direct-write operations may replace their contents.
No Built-In Undo
Bulk operations do not provide an undo history for already saved output files.
Best Practices
- Preserve an original copy of your project.
- Test commands on a small directory first.
- Run simple commands before complex combinations.
- Check generated output before deployment.
- Use distinct source and destination directories.
Next Steps
See Bulk Command Reference for detailed explanations and examples of every supported command.
Updated 9 days ago
