Didier Stevens

Monday 5 July 2021

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:


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

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply (comments are moderated)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.