Blog entry by Craig Blair

Craig Blair
by Craig Blair - Friday, 14 March 2025, 11:54 AM
Anyone in the world

Use Terminal for Batch Find and Replace

If you want to replace text in multiple text-based files (like .txt, .csv, .html, .md), you can use sed in the Terminal:

1. Open Terminal.

2. Navigate to the folder where your documents are located:

cd /path/to/your/documents

3. Run the following command:

sed -i '' 's/oldWord/newWord/g' *.html

Replace oldWord with the word you want to change.

Replace newWord with the new word.

Change *.html to the correct file extension (e.g., .md, .csv).

If the files are Word (.docx), you’ll need to convert them to plain text or use a Word macro.