#!/usr/bin/awk -f # remover removes parts of a textfile. # start and stop tags are provided as parameters # usage: remover.awk t1=TAG1 t2=TAG2 FILE BEGIN { split(ARGV[1], argarr, "="); start = argarr[2]; split(ARGV[2], argarr, "="); stop = argarr[2]; omit = 0; } { if ( $0 ~ start ) omit = 1; if ( omit == 0 ) print; if ( $0 ~ stop ) omit = 0; }