help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] have the same column L


From: Dennis Williamson
Subject: Re: [Help-bash] have the same column L
Date: Thu, 13 Jul 2017 21:01:15 -0500

On Jul 13, 2017 8:30 PM, "Val Krem" <address@hidden> wrote:

Hi all,

How can I starndarzied string column to have the same column length for
each row.

Example
filename

A135953
D10036050
C135858000

I want add leading zeros and the column length should be 10

I tried
awk '{ printf "%010s \n", $1}' filename

Got all zeros
0000000000
0000000000
0000000000
0000000000

But I want
000A135953
0D10036050
C135858000


I would appreciate if you help me out.

thank you in advance


Your question is not about Bash so this is the wrong list.

However your AWK code works for me. You probably have something in column 1
in your file other than what you think you do.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]