Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Merging multiple variations of a serial number

by tangent (Parson)
on Jul 28, 2022 at 16:34 UTC ( [id://11145822]=note: print w/replies, xml ) Need Help??


in reply to Merging multiple variations of a serial number

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found