New Tool: texteditor.py
2021-07-05 09:00:00 Author: blog.didierstevens.com(查看原文) 阅读量:123 收藏

New Tool: texteditor.py

Filed under: My Software — Didier Stevens @ 0:00

I have some ad hoc tools, that help me with special text editing tasks. Like doing search and replace in a text file, with a list of search and replace terms. Or looking for assignment statements in the source code of a program, and replacing each variable with its value.

I decided to bundle these ad hoc scripts, into a single generic script, a new tool: texteditor.py

Here is an example, take text file example.txt with the following content:

There is an apple on the sun.
It is nice and warm.

And CSV file sar.csv with the following content:

apple,pear
sun,moon

The following sarcsv command edits file example.txt with sar.csv:

./texteditor.py input=example.txt edit=sarcsv,file=sar.csv output=-

The output of this command is:

There is an pear on the moon.
It is nice and warm.

texteditor_V0_0_1.zip (https)
MD5: C8BA3AA8E8549B0159B76CF4A520976B
SHA256: D605DF7560C0CDBDCA3F4C1B1DC11EE9765813149B60D144714CF1C6E92CEC22

No comments yet.


文章来源: https://blog.didierstevens.com/2021/07/05/new-tool-texteditor-py/
如有侵权请联系:admin#unsafe.sh