If I could ++ 10 times that mention of grep -F -f..., I would.
I didn't know about that grep option.
For the perl approach, depending on the number of "serials", Regex::PreSuf might be able to turn @serials into one regex, which would likely be very ugly, but likely faster.
However, it's likely to be impossible to beat doing the grep -F -f and then post-processing the results file to split into separate serial files - for example, if the serial column is easily found, the sort program could sort the result by serial #, making the split very simple.
For bulk applications, /usr/bin/grep and /usr/bin/sort can sometimes beat perl's speed by large margins, so it's worth trying them.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.