Skip to content
simonc edited this page Sep 13, 2010 · 5 revisions

There are two ways to search and replace text with AbsoluteRenamer.

Filters ordering

Multiple search and replace actions can be specified in the same command.
They’re called in the same order they are defined.

An important thing to notice is that their position before or after the format option is important.
The filters defined before the format are applied to the original filename.
The filters defined after the format are applied to the transformed filename.

absrenamer -r"_," -f"[1;6]" hello_world.txt
#=> hello_.txt

absrenamer -f"[1;6]" -r"_," hello_world.txt
#=> hello.txt

Using simple text

To simply search and replace text, the option is -r.

absrenamer -r"world,anyone" hello_world.txt
#=> hello_anyone.txt

absrenamer -r"o_world," hello_world.txt
#=> hell.txt

Using regular expressions

To use a more advanced technique with regular expressions, the option is -e.

absrenamer -e"h.*o,test" hello_world.txt
#=> testrld.txt

absrenamer -e"h.*?o,test" hello_world.txt
#=> test_world.txt