The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 04-28-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652

Code:
sed -e 's/.*pmin=/s%Sieved to [0-9]*%Sieved to /;s/,factor.*/%/' checkpoint.txt |
sed -f - otherfile

If your sed won't do "-f -" you will have to save to a temporary file.

The repetition of "Sieved to " can be avoided, but is left as an exercise.