Link: Bulk Replace Text In Many Text Files

Finding and replacing text in a single text file is simple, you can use the Find and Replace function within the edit menu of your text application. The problem arises is want to use this feature in many text files. You can open each one, but that is a little complicated. Today we are going to adapt a script within terminal to carry out this command on a set of text files within a folder. It will open each text file, search for the exact or partial string and then replace it with the text we want. This is a little complicated but a great time saver.

Note: While this article was written specifically for use with OS X, the technique shown should also work in Linux and similar OS’s, with the caveat that perl must be installed on the system.

Bulk Replace Text In Many Text Files (MacTricksAndTips.com)

Leave a Reply

Your email address will not be published. Required fields are marked *

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