This is a version of the CIAO dmcopy tool that takes in a table along with a stack of filters and a stack of output files. Then in 1 pass through the input file it applies each of the filters to create the outputs files all at once.
$ dmscopy acis_evt1.fits "[grade=0,2,3,4,6],[grade=5,7]" good_grades.fits,bad_grades.fits
$ dmscopy acis_evt.fits "ccd_id=igrid(0:9:1)" "out_igrid(0:9:1).fits"