align: text column alignment filter
Download Version 1.7.5 || Feedback

Align is a general-purpose text filter tool that helps vertically align columns in string-separated tables of input text. With whitespace-separated columns, you can often use it without arguments and it'll guess the right thing to do. Otherwise, you can specify arguments to direct how the columns are separated on input and rejoined in the aligned output. For example,

$ head -5 access.log - 04/Dec/2000:04:08:53 GET /pub HTTP/1.0 408 - 23146 - 04/Dec/2000:07:17:32 GET /zen HTTP/1.0 404 272 27583 - 04/Dec/2000:09:37:56 GET / HTTP/1.0 200 8135 658 - 04/Dec/2000:13:25:00 GET / HTTP/1.1 200 8135 8850 - 04/Dec/2000:15:04:29 GET / HTTP/1.1 408 - 12305

$ head -5 access.log | align  - 04/Dec/2000:04:08:53 GET /pub HTTP/1.0 408 -    23146     - 04/Dec/2000:07:17:32 GET /zen HTTP/1.0 404 272  27583  - 04/Dec/2000:09:37:56 GET /    HTTP/1.0 200 8135   658 - 04/Dec/2000:13:25:00 GET /    HTTP/1.1 200 8135  8850    - 04/Dec/2000:15:04:29 GET /    HTTP/1.1 408 -    12305

Here, align correctly guessed that columns were separated by a single space character and generated an alignment using multiple spaces between columns. Also, the type of alignment within a column can be specified to be left, right, center, numeric or zero-padded numeric.

Also included in this package is width, another general-purpose text filter tool that helps you work with the printing width or length of lines of input text. For example, it can print the width, location and/or content for its longest line or lines of input, or for all lines. For example,

% head -5 access.log | width -awnl
63:1: - 04/Dec/2000:04:08:53 GET /pub HTTP/1.0 408 - 23146 - 04/Dec/2000:13:25:00 GET / HTTP/1.1 200 8135 8850

Running align -h and width -h will provide complete usage summaries.


"align" and "width" are Perl scripts that you should be able to install as-is, ie executable in a directory in your PATH. Edit the first line of the scripts, if necessary, to contain the proper path to your perl executable. Alternately, you can use the supplied Makefile to do all this. Just edit the top of the Makefile to your desires and then run:

make install
GPL Copyright

Copyright © 2000-2001 Stephen B Kinzler
Copyright © 1993-2001 Stephen B Kinzler

These programs are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with these programs (see the file "COPYING"); if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Software by Steve Kinzler

Unix Home Dir
Many scripts and config files for Unix/X11 environments
A text column alignment filter
A visual shell and CLI shell supplement
Tools to interface web browsers to the Unix user CLI
Set window title and icon name for an X11 terminal window
A convenience frontend for tar, gzip, zip, etc

Steve Kinzler <>
December 2001

<>, a offering About page style