sreplace

Crates.iosreplace
lib.rssreplace
version0.9.5
sourcesrc
created_at2023-04-23 16:23:57.37193
updated_at2024-01-08 21:06:05.379749
descriptionA simple to use, efficient, and full-featured command line string replacer.
homepagehttps://gitlab.com/miyamoto128/sreplace
repositoryhttps://gitlab.com/miyamoto128/sreplace
max_upload_size
id846663
size6,501,391
Ogami Itto (ogamiitto)

documentation

README

sreplace

A simple to use, efficient, and full-featured command line string replacer.

Sed like command line tool that aims to be simple and fast to use.

This is a rewritting of a former project of mine, from C++ to rust.

Installation

  1. install rust
  2. install sreplace using cargo:
cargo install sreplace

The ready to use executable command is sr.

Usage

sr <PATTERN> <REPLACEMENT> <PATH>

Arguments:
  <PATTERN>      The string to look for
  <REPLACEMENT>  The replacement string
  <PATH>         The path to the file or directory

Examples

$ cat hello.txt
Hello world!

$ sr world all hello.txt
Replaced 1 line in "hello.txt"

$ cat hello.txt
Hello all!

Replace in regular file

Replace in regular file

Replace recursively in folder

Replace in folder

Features

  • UTF-8 encoding support
  • Support regular expression searched patterns
  • Support case insensitive searched patterns
  • Filter on regular files extensions
  • Recursively browse directories
  • Concurrently process multiple files

License

GPL v3

Commit count: 39

cargo fmt