The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
RegExp - settle a bet earnstaf UNIX for Dummies Questions & Answers 2 04-17-2008 02:23 PM
regexp help TinCanFury Shell Programming and Scripting 0 04-06-2008 06:21 PM
perl regexp mirusnet Shell Programming and Scripting 1 04-04-2008 04:15 PM
regexp penfold UNIX for Advanced & Expert Users 1 06-28-2005 07:45 AM
vi + regexp + substitute Lomic UNIX for Dummies Questions & Answers 9 12-10-2004 10:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-03-2007
andy2000 andy2000 is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 36
regexp with sed again!!!

please help:

I want to add 1 space between string and numbers:
input file:
abcd12345
output file:
abcd 1234

The following sed command does not work:

sed 's/\([a-z]+\)\([0-9]+\)/\1 \2/' file

Any ideas, please

Andy
  #2 (permalink)  
Old 05-03-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
$ echo abcd12345 | sed 's/\([a-z]\{1,\}\)\([0-9]\{1,\}\)/\1 \2/'
abcd 12345
$ echo abcd12345 | sed "s/[0-9]/ &/"
abcd 12345
Extended regular expression operators are not available in sed
  #3 (permalink)  
Old 05-03-2007
esham's Avatar
esham esham is offline
Registered User
  
 

Join Date: Nov 2004
Location: INDIA
Posts: 107
can for for this also..

Quote:
echo "abSWWWcd23423" | sed 's/\([a-zA-Z]\)\([0-9]\)/\1 \2/'
shameer
www.openhat.org
Sponsored Links
Closed Thread

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 03:08 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