I may be totally wrong, but I get the feeling the people suggesting MD5 and other hashing methods focused too much on the performing thousands of times. If it were being performed thousands of times on the same file, or a small number of files, hashing would be worthwile. But here it's thousands of files, each one once. Since hashing is more expensive than grepping, there's no benefit. Anyway, you would need to hash paragraph by paragraph, and thus store a number of hashes for each files, one for each paragraph.
Tell you what I would do ...
Save the paragraph you're looking for in a file. Read in the paragraph file at the beginning of the script. Then go through the other files, passing over any that are newer than the paragraph file, processing only older files. That way, if you have to stop the script or the system crashes, you don't have to re-do things. of course, processing the files may not actually take all that long, in which case the minor delay caused by checking creation date will not be significant.
--
TTTATCGGTCGTTATATAGATGTTTGCA
In reply to Re: Efficiency: Finding if a file contains a paragraph
by TomDLux
in thread Efficiency: Finding if a file contains a paragraph
by C_T
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |