---

Scripting a ‘Find-and-Replace’ for big text files

I use two different GUI text editors. Mousepad does my basic editing jobs in a single window, while Gedit gives me tabbed windows, syntax highlighting and (with the Draw Spaces plug-in) a toggle-able view of whitespace and tabs.

Unfortunately, both Mousepad and Gedit struggle with big text files, say 10 mb and up.
In contrast, finding strings on the command line with grep is zippety-quick, even for huge text files. String replacement with sed is also pretty fast. I recently wrote a simple shell script for finding-and-replacing in some very large text files I was editing.