The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: Sed Question?
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-02-2008
KevinADC KevinADC is offline
Registered User
 

Join Date: Jan 2008
Posts: 338
I'm not really a sed coder but I think it is the same as perl in this situation with the excpetion that sed does inplace editing by default (I could be wrong). The problem is you have not described your input besides saying it has those sequence of ranges you posted.

Code:
sed -e 's/([0-9]+)(-)([0-9]+)/{\1..\2}/g' file
Anyway, see if it works, backup your file first. If I am totally wrong someone will correct me.
Reply With Quote