replace lines in files with set of rules
Because python, yaml and similar are based on the proper identation. Using there jinja/sed/awk - you name it - can cause a lot of errors. This is a solution.
You want multiple replacement rules? Are you tired of the chains of seds? Here you go!
- Install rust
- Build the software
git clone https://github.com/Dzordzu/rule-replace
cd ./rule-replace
cargo build --releaseIn shell rule-replace -c config.toml -f input.txt
config.toml
[[rule]]
replace.lines_between = ["# BEGIN", "# END"]
keep_spaces = true
[rule.with]
template = "./template.j2"
values = "./values.json"For more see example directory. Inputs and expected outputs are presented
within each suite tests subdirectory.