The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-30-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
might be a bit lengthy, but.,

Code:
nawk -f gus.awk myFile

gus.awk:

Code:
{
  while( match($0, "[0-9][0-9]*")) {
    len=substr($0, RSTART, RLENGTH)
    for(i=1;i<=len;i++) rep=(i==1)?".":rep "."
    sub(len rep, "")
  }
}
1


Last edited by vgersh99; 06-30-2009 at 03:30 PM..