From 781d06a102d9c860ff66be0be496c599a1420326 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 5 Apr 2018 08:48:14 +0100 Subject: [PATCH] repren: add page (#2054) --- pages/common/repren.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/common/repren.md diff --git a/pages/common/repren.md b/pages/common/repren.md new file mode 100644 index 000000000..06a902a4f --- /dev/null +++ b/pages/common/repren.md @@ -0,0 +1,23 @@ +# repren + +> Multi-pattern string replacement and file renaming tool. + +- Do a dry-run renaming a folder of pngs with a literal string replacement: + +`repren --dry-run --rename --literal --from '{{find_string}}' --to '{{replacement_string}}' {{*.png}}` + +- Do a dry-run renaming a folder of jpegs with a regular expression: + +`repren --rename --dry-run --from '{{regular_expression}}' --to '{{replacement_string}}' {{*.jpg}} {{*.jpeg}}` + +- Do a find-and-replace on the contents of a folder of csv files: + +`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}} *`