# 950614, 950623, 951018, 951020 # 2007-08-27 # # Purpose: Weeds (deletes) unwanted header lines from "folders" # (text files containing emails) # Installation: Save this script as "weedout.sed". # Usage: sed -f weedout.sed folder > folder.weeded # :again /^Received:/{ N s/^.*\n// :blah /^[ ]/{ N s/^.*\n// b blah } b again } # # Comment the lines which you want to keep with a "#" # NOTE: Case of characters matters! # /^Approved:/d #/^Content-.*:/d /^Distribution:/d /^Errors-to:/d /^Errors-To:/d /^Full-Name:/d /^In-Reply-To:/d /^Lines:/d /^List-/d /^Message-ID:/d /^MIME-Version:/d /^Message-Id:/d /^Mime-Version:/d /^NNTP-Posting-Host:/d /^Organisation:/d /^Organization:/d /^Path:/d /^Phone:/d /^Post:/d /^Precedence:/d /^Received:/d /^References:/d /^Return-Receipt-to:/d /^Return-Receipt-To:/d /^Reply-To:/d /^Resent:/d /^Return-Path:/d /^Sender:/d /^Sent:/d /^Status:/d /^Supercedes:/d /^Supersedes:/d /^Telephone:/d /^X-[a-zA-Z-]*:/d # /^X-Face:/d # /^X-Location:/d # /^X-Mailer:/d # /^X-Status:/d # /^X-Sun-Charset:/d # /^X-URL:/d # /^X400/d # End of script