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: Greg Wooledge
Subject: Re: [Help-bash] have the same column L
Date: Fri, 14 Jul 2017 15:35:55 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Jul 14, 2017 at 03:20:58PM -0400, Chris F.A. Johnson wrote:
> On Fri, 14 Jul 2017, Val Krem wrote:
> > A135953
> > D10036050
> > C135858000
> > 
> > I want add leading zeros and the column length should be 10
> > 
> > I tried
> > awk '{ printf "%010s \n", $1}' filename
> 
>   awk '{ printf "%010d \n", $1}' filename

Yeah, except his input isn't numeric.  We don't know what it is, because
he won't TELL US.

$ echo "A135953" | awk '{ printf "%010d \n", $1}'
0000000000 

Asking to zero-pad these non-numeric strings is completely nonsensical,
so I'm just waiting for a real explanation.  I don't expect one to
come out.  This person has a long history of asking ridiculous things
out of the blue.  It all smells like homework.

Some other people on the list have guessed that perhaps the input
strings are hexadecimal, and have given printf commands that would
be appropriate for that case.



reply via email to

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