Prefetch Technologies // Keeping your cache lines cozy

Massaging data with fmt and sed

I had to cleanup a few documents today, and wanted to transform the text into an 80-column file with 4 spaces in the left margin. This was easily accomplished with the following shell pipeline:

$ cat messedup.txt | sed 's/^/ /' | fmt -80 > messedup.txt.new

I was lucky that the file had a basic form, since it minimized the number of items in my pipeline. :)