in reply to How to remove lines out of an ascii file

If you do in fact *really* want to removes lines from the file you may want to use the flip-flop operater suggested above and try and take advantage of perl's edit in-place command-line switch like so
# cnt=`wc -l filename | sed -e 's/ *\([0-9]\+\).*/\1/'` # perl -ni -e 'print if /^CPN/ .. '$cnt';' filename
Admittedly that's very filthy, but if you use eof() you loose the last line (or at least I do). I'm sure there's a *far* better wholly perl solution, but that works just fine (if you've got a unix and gnu ;o)
HTH

broquaint