2018-04-05 08:48:14 +01:00
|
|
|
# repren
|
|
|
|
|
|
|
|
> Multi-pattern string replacement and file renaming tool.
|
2019-01-30 11:51:51 +00:00
|
|
|
> Homepage: <https://github.com/jlevy/repren>.
|
2018-04-05 08:48:14 +01:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Do a dry-run renaming a directory of pngs with a literal string replacement:
|
2018-04-05 08:48:14 +01:00
|
|
|
|
|
|
|
`repren --dry-run --rename --literal --from '{{find_string}}' --to '{{replacement_string}}' {{*.png}}`
|
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Do a dry-run renaming a directory of jpegs with a regular expression:
|
2018-04-05 08:48:14 +01:00
|
|
|
|
|
|
|
`repren --rename --dry-run --from '{{regular_expression}}' --to '{{replacement_string}}' {{*.jpg}} {{*.jpeg}}`
|
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Do a find-and-replace on the contents of a directory of csv files:
|
2018-04-05 08:48:14 +01:00
|
|
|
|
|
|
|
`repren --from '{{([0-9]+) example_string}}' --to '{{replacement_string \1}}' {{*.csv}}`
|
|
|
|
|
|
|
|
- Do both a find-and-replace and a rename operation at the same time, using a pattern file:
|
|
|
|
|
|
|
|
`repren --patterns {{path/to/patfile.ext}} --full {{*.txt}}`
|
|
|
|
|
|
|
|
- Do a case-insensitive rename:
|
|
|
|
|
|
|
|
`repren --rename --insensitive --patterns {{path/to/patfile.ext}} *`
|