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: Seth David Schoen
Subject: Re: [Help-bash] have the same column L
Date: Thu, 13 Jul 2017 18:39:52 -0700
User-agent: Mutt/1.5.24 (2015-08-30)

Val Krem writes:

> 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'm not sure if this is GNU sed-specific, but you could use

sed -r ':x; /^.{,9}$/ s/^/0/; tx'

-- 
Seth David Schoen <address@hidden>      |  No haiku patents
     http://www.loyalty.org/~schoen/        |  means I've no incentive to
  8F08B027A5DB06ECF993B4660FD4F0CD2B11D2F9  |        -- Don Marti



reply via email to

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