You could use fgrep. Fgrep is faster than grep. Before, you should transform the database file such that each sequence takes one line without blank and without line breaks (using tr and sed) Database files are optimized for hole cards for historical reasons. Lines are wrapped after at least after 72 characters, preventing the use of fgrep.