#!/usr/bin/env perl use strict; use warnings; my @fields; # For the longer 1st Column name, I added some more spaces so it won't concat the name. NOt sure how the left-justify can be done with this format STDOUT statement? format STDOUT = @<<<<<<<<<<<< -@#####.###### @####.###### @<<<<<< @fields . while (my $line = ) { chomp $line; @fields = split /\s+/, $line, 4; unshift @fields, ' ' if 4 > @fields; write; } # All four columns should be left-justified and should line up whether it is a positive or negative number. __DATA__ MM_STD_gate -61.771653 -45.472441 mils -1569.000000 -1155.000000 microns RFN_a -91.102362 68.307087 mils -2314.000000 1735.000000 microns RFN_b -62.165354 68.307087 mils -1579.000000 1735.000000 microns RFN_c -51.417322 68.307087 mils -1306.000000 1735.000000 microns MM_STD2_gate 259.488188 -22.047244 mils 6591.000000 -560.000000 microns RBASE_right_2 366.181102 -33.464566 mils 9301.000000 -850.000000 microns