I have to compare a large number (tens of millions) of strings (all same length, pretty short) in a file (one string per line), to an even larger number (hundreds of millions) of strings (again, all same length as before, one string per line).
In each file, each string is unique, i.e. encountered only once in that file.
Note: the strings are made of only letters. More exactly, 4 letters - nucleotide bases (A,C,G,T).
I am looking ONLY for EXACT matches.
What approach would be really super-fast?
Many thanks in advance!!!
Wow! So many interesting and elegant solutions! I will try a few!
For those who were considering the length of the strings: it is currently 32, but the code really has to work with any length between 25-100.
In reply to Comparing strings (exact matches) in LARGE numbers FAST by perlSD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |