The UNIX and Linux Forums  

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to convert a 2 digit to 4 digit jisha Shell Programming and Scripting 6 04-23-2008 07:38 AM
why "expr "${REPLY}" : '\([1-9][[:digit:]]*\)" can figure out whether it is a digit? sleepy_11 Shell Programming and Scripting 6 08-08-2007 04:51 AM
Extracting 10 digit number from txt files c19h28O2 Shell Programming and Scripting 9 08-07-2006 07:06 PM
converting 6 digit column to dates format Gerry405 UNIX for Dummies Questions & Answers 15 10-06-2005 07:42 AM
calculating a check digit jim9418 UNIX for Dummies Questions & Answers 1 02-16-2005 03:14 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-17-2008
Jae Jae is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 24
Replace one digit by two digit using sed

Folks,

Is there a simple way to replace one digit by two digit using sed.

Example,
mydigit1918_2006_8_8_lag1.csv should be
mydigit1918_2006_08_08_lag01.csv.

I tried this way, but doesn't work.
echo mydigit1989_2006_8_8_lag1.csv|sed 's/[[:digit:]]/0[[:digit:]]/'

Thank you,
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0