In Excel I do a MATCH, assign a number to each line on one side, then do a Sort that lines them all up. It's all recorded in a macro that is very specific to the input format. I've contemplated moving this to Access as I think it could do a better job, but it would take some work to set it all...