I would use a table structure, say a SQLite database, though you could use a tied array or CSV file. I would create a table something like this:

d15d14d13_v1d13_v2d12d10checkmonthyear
0122123160001400122123160001422123160001401221231600014221231600014123160001400122

The first step to create the table would be to take the 15 digit variations and generate all the other columns for each. Move on to the 14 digit variations, see if there is a 15 digit one (select * where d14 = ?) and if not create a new row and generate as many of the other columns as you can. Keep doing this all the way. For the 13 digit variations only add the ones that can be disambiguated (as hippo and others have pointed out).

At the end you will be left with a list of 13 digit ones that haven't been added. You can look these up in the table to see possible matches but will probably need to manually sort these.


In reply to Re: Merging multiple variations of a serial number by tangent
in thread Merging multiple variations of a serial number by Doozer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.