Replacement for tr/sed replace in python
Project description
riptr
Text substitution similar to tr
or sed s//
but without the frustration. Uses plain old python regex style.
Installing
Now deployed to pypi, install with:
pip install riptr
This adds the riptr
and rtr
cli tools to your python environment path.
Usage
echo "some example text 1234" > test.file
# default output is stdout
riptr -m "^(.*?)([\d]{2})" -s "\g<1>56" test.file
some example text 5634
# specify patch mode 'p'
riptr -m "^(.*?)([\d]{2})" -s "\g<1>56" -o p test.file
---
+++
@@ -1 +1 @@
-some example text 1234
+some example text 5634
# or inplace
riptr -m "^(.*?)([\d]{2})" -s "\g<1>56" -o i test.file
cat test.file
some example text 5634
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.
See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for riptr-1.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b743033473f35b9b0617e9089855fc04aea97a1dad80272a4000c206c38301a7 |
|
MD5 | e2ee4494b7733b8ee47638be2759b8a5 |
|
BLAKE2b-256 | 048636765460d353dbf4c60ec5442bcfca2362b30fffe894d4d90ace0f4a244e |