The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-06-2007
sbasetty sbasetty is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 75
Padding with zeros.

Hi Friends,

I would like to left pad with "0's" on first column say (width six)
I have a large file with the format:


FILE:

1: ALFRED 84378 NY
8385: JAMES 88385 FL
323: SMITH 00850 TX

My output needs to be like:

000001: ALFRED 84378 NY
008385: JAMES 88385 FL
000323: SMITH 00850 TX


Thanks in advance for your help