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 described in this chapter, you can apply the same set of edits quickly and easily to many files, either as a one-off job, or as part of a periodic routine.




Mac OS X UNIX 101 Byte-Sized Projects
Mac OS X Unix 101 Byte-Sized Projects
ISBN: 0321374118
EAN: 2147483647
Year: 2003
Pages: 153
Authors: Adrian Mayo

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net