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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need help in substitution!!!! uLearner UNIX for Dummies Questions & Answers 3 03-06-2008 07:21 PM
AWK substitution klut Shell Programming and Scripting 4 01-15-2008 11:26 AM
Bad Substitution D_Redd74 Shell Programming and Scripting 3 02-07-2007 05:48 PM
ksh substitution solea Shell Programming and Scripting 2 08-09-2004 05:30 AM
substitution supercbw Shell Programming and Scripting 1 06-07-2002 03:07 PM

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 06-21-2002
jo_aze jo_aze is offline
Registered User
  
 

Join Date: Feb 2002
Location: PARIS (FRANCE)
Posts: 22
sed substitution

Hi,

I have a set of files containing strings like I.TEST1_TEST2 or B.ESSA_ESSB for example.

Does somebody know how to substitute these strings whith the same name and an extension "_V1" (ie. I.TEST1_TEST2_V1) using sed command or else ?
  #2 (permalink)  
Old 06-21-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Try this:
sed 's/\([A-Z]\)\.\([A-Z0-9]*\)_\([A-Z0-9]*\)/\1.\2_\3_V1/'
  #3 (permalink)  
Old 06-21-2002
jo_aze jo_aze is offline
Registered User
  
 

Join Date: Feb 2002
Location: PARIS (FRANCE)
Posts: 22
It's ok.
Thanks for your reply.
  #4 (permalink)  
Old 06-23-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
If all that your files had were lists of these type of names...then you could also use

sed 's/$/_V1' filename

This would just add "_V1" to then end of each line. Might be easier if this is all that your files have in them.
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 07:44 PM.


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