https://github.com/jpikl/rew
A text processing CLI tool that rewrites FS paths according to a pattern.
https://github.com/jpikl/rew
command-line command-line-tool copy-files regex rename-files replace-text rust terminal text-processing tool
Last synced: 2 months ago
JSON representation
A text processing CLI tool that rewrites FS paths according to a pattern.
- Host: GitHub
- URL: https://github.com/jpikl/rew
- Owner: jpikl
- License: mit
- Created: 2020-03-16T02:33:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T22:02:10.000Z (about 1 year ago)
- Last Synced: 2024-04-14T07:41:57.135Z (about 1 year ago)
- Topics: command-line, command-line-tool, copy-files, regex, rename-files, replace-text, rust, terminal, text-processing, tool
- Language: Rust
- Homepage: https://jpikl.github.io/rew/
- Size: 2.61 MB
- Stars: 40
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rew
A text processing CLI tool that rewrites FS paths according to a pattern.
[](https://github.com/jpikl/rew/actions/workflows/ci.yml)
[](https://codecov.io/gh/jpikl/rew)
[](https://crates.io/crates/rew)
[](https://deps.rs/repo/github/jpikl/rew)
[](https://crates.io/crates/rew)
[](https://github.com/jpikl/rew/blob/master/LICENSE.md)## How rew works
1. Reads values from standard [input](https://jpikl.github.io/rew/input.html).
2. Rewrites them according to a [pattern](https://jpikl.github.io/rew/pattern.html).
3. Prints results to standard [output](https://jpikl.github.io/rew/output.html).
Input values are assumed to be FS paths, however, `rew` is able to process any UTF-8 encoded text.
```bash
find -iname '*.jpeg' | rew 'img_{C}.{e|l|r:e}'
````rew` is also distributed with two accompanying utilities (`mvb` and `cpb`) which move/copy files and directories, based on `rew` output.
```bash
find -iname '*.jpeg' | rew 'img_{C}.{e|l|r:e}' -d | mvb
```## Documentation
- [📦 Installation](https://jpikl.github.io/rew/install)
- [🚀 Usage](https://jpikl.github.io/rew/usage)
- [✏️ Pattern](https://jpikl.github.io/rew/pattern)
- [🛤 Path filters](https://jpikl.github.io/rew/filters/path)
- [🆎 Substring filters](https://jpikl.github.io/rew/filters/substr)
- [📊 Field filters](https://jpikl.github.io/rew/filters/field)
- [🔍 Replace filters](https://jpikl.github.io/rew/filters/replace)
- [⭐️ Regex filters](https://jpikl.github.io/rew/filters/regex)
- [🎨 Format filters](https://jpikl.github.io/rew/filters/format)
- [🏭 Generators](https://jpikl.github.io/rew/filters/generate)
- [⌨️ Input](https://jpikl.github.io/rew/input)
- [💬 Output](https://jpikl.github.io/rew/output)
- [🔬 Comparison](https://jpikl.github.io/rew/comparison)
- [🗃 Examples](https://jpikl.github.io/rew/examples)
- [📈 Changelog](https://jpikl.github.io/rew/changelog)## License
`rew` is licensed under the [MIT license](LICENSE.md).