Chapter 7. Programmatically Change Files

This chapter is about editing text files with Unix text-processing utilities. These utilities work from scripts or simple editing instructions and automatically edit files by following those instructions. The seven projects cover the following topics:

  • Utilities to filter files. Apply simple transformations such as stripping blank lines and converting to lowercase.

  • Batch-editing files.  Search for files to process and apply the same set of edits to each file.

  • The sed stream editor.  Make complex modifications to a file by writing a script of editing commands.

  • The awk pattern-scanning and processing language. Like sed, awk works from a script, but its scripting language is more powerful.

By using the techniques ...

Get Mac OS X UNIX 101 Byte-Sized Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.