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

  1. Select Bulk from the mode selector.
  2. Click Open to select a source directory.
  3. Enter the bulk commands.
  4. Specify an Output Folder name.
  5. Click Run.
  6. Select a destination directory if prompted.
  7. Review the completion status and resulting files.

Example: Replace Text Across Files

Suppose several source files contain:

version=1

You want to replace the value with:

version=2

Enter:

FIND_REPLACE|version=1|version=2

Select 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|ARGUMENT2

Some commands require only one argument:

FIND_DELETE|unwanted

Other commands require two:

FIND_REPLACE|old|new

Enter 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|// Updated

The 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:

CategoryExtensions
Text and Documentationtxt, md
Web Developmentjs, ts, jsx, tsx, html, css, scss
Structured Datajson, xml, yml, yaml, csv
Configurationini, conf
Programmingpy, 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.js

Example output:

edited-output/
├── index.html
├── styles.css
└── scripts/
    └── app.js

Unsupported 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 files

Source 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:

  1. Select a folder using the browser's directory-upload capability.
  2. Enter the bulk commands.
  3. Specify an output folder name.
  4. Click Run.
  5. Download the generated ZIP archive.

For example:

edited-output.zip

The 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

  1. Preserve an original copy of your project.
  2. Test commands on a small directory first.
  3. Run simple commands before complex combinations.
  4. Check generated output before deployment.
  5. Use distinct source and destination directories.

Next Steps

See Bulk Command Reference for detailed explanations and examples of every supported command.


Did this page help you?