start page | rating of books | rating of authors | reviews | copyrights

Unix Power ToolsUnix Power ToolsSearch this book

Chapter 21. You Can't Quite Call This Editing

Contents:

And Why Not?
Neatening Text with fmt
Alternatives to fmt
Clean Up Program Comment Blocks
Remove Mail/News Headers with behead
Low-Level File Butchery with dd
offset: Indent Text
Centering Lines in a File
Splitting Files at Fixed Points: split
Splitting Files by Context: csplit
Hacking on Characters with tr
Encoding "Binary" Files into ASCII
Text Conversion with dd
Cutting Columns or Fields
Making Text in Columns with pr
Make Columns Automatically with column
Straightening Jagged Columns
Pasting Things in Columns
Joining Lines with join
What Is (or Isn't) Unique?
Rotating Text

21.1. And Why Not?

Summary Box

There are many specialized forms of editing that happen frequently enough that they sometimes want to be saved into a script. Examples of this kind of thing include:

 
  • fmt (Section 21.2) and related scripts (Section 21.3) for reformatting jagged lines into neat paragraphs

  • recomment (Section 21.4), a script for reformatting comment blocks within programs and scripts

  • behead (Section 21.5), a script for removing the headers from mail and news messages

  • center (Section 21.8), a script for centering lines of text in a file

In addition, there are a number of programs that provide some useful ways of modifying files but that you don't normally think of as editors:

 
  • split (Section 21.9) and csplit (Section 21.10) let you split a big file into smaller pieces.

  • tr (Section 21.11) lets you substitute one character for another -- including non-printing characters that you specify by their octal values.

  • dd (Section 21.6, Section 21.13) lets you perform various data conversions on a file.

  • cut (Section 21.14) lets you cut columns or fields out of a file, and paste (Section 21.18) lets you put them back, perhaps in a different order.

This chapter covers all that and more.

 

-- TOR



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.