hi guys, I have a need to generate a unique ID based on a few rules.
Eg: rule -> use first 4 characters of the town/ site-name, or add a fill character if less than 4 long...( say "_" )
if a conflict (ie: ID already exists) , then go to the next character till conflict is resolved.
if still unresolved, go to the first character in the next word and so on till resolved. ( multiple words could be treated like a single word, by removing spaces maybe)
(to resolve conflicts, it would only need to check all existing ID's that match first 3 characters, to save complexity )
Data example
SITE-Name
wolli creek = woll
wollongbar = wolo
wollongong lands = woln
wollongong Water = wolg
wollongong SRD = wols
wollongong minerals = wolm
wollstonecraft = wolt
I was expecting to use a macro in excel or generate it in an excel formula etc, or it could be readily run under VB and pasted into excel.. either method will do.
the code would need to progress down a list, generating a unique 4 character id, New additions could be simply be inserted, and the code could check and add the unique ID.
alternatively, we could easily process a list of site-names using a vb script or unix script like bash etc..
anyone seen any code that could do this or something similiar ?
Bookmarks