UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 8th, 2005, 08:54 AM
galarraga galarraga is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Caracas, Venezuela
Posts: 81 galarraga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 56 m 23 sec
Reputation Power: 5
replacing the last occurence of a character in a line

Hi everybody

I know this sentence to replace the first occurrence of a comma in a line by a point:

Code:
sed -e "s/,/./"


but I want to replace just the last occurence of a comma in a line

Can anyone tell me how?

thanks in advance

Reply With Quote
  #2  
Old September 8th, 2005, 09:46 AM
vgersh99 vgersh99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 47 vgersh99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 5 h 48 m 21 sec
Reputation Power: 4
Send a message via AIM to vgersh99 Send a message via MSN to vgersh99 Send a message via Yahoo to vgersh99
echo 'abc,def,12379,foo' | sed 's/\(.*\),/\1./'

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > replacing the last occurence of a character in a line


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT