in reply to Text file filtering

IIUC, the headers stand on a line by themselves. Then, you might want to have a look at the flip-flop operator (..).

perldoc perlop

while ( <> ) { if ( /\(\+Header1\)/ .. /\(-Header1\)/ ) { # you're in part one } if ( /\(\+Header2\)/ .. /\(-Header2\)/ ) { # you're in part two } if ( /\(\+Header3\)/ .. /\(-Header3\)/ ) { # you're in part three } }

HTH

--bwana147