/filter -if $dname $id print.txt
or /savebuf -o $dname $id filename