خرید بک لینک

Vote count: 0

I have a large list of thousands of names, with the entries that contain multiple names being separated by either comma or semi-colon, or even occasionally not. For instance:

Last, First, Last, First A., Last, First, Ph.D, Last, First, M.D., Last, A. B, Last, First Middle plus other names, Last, First, Jr., Last, First Sr.
Last, First; Last, First A.; Last, First Middle, 
… First Last, Jr.

I'm trying to create a function that would reliably retu a list with everything properly ordered as "First Last" with any possible suffixes like Jr, M.D, etc. So far, from another SO question, I have:

names = [b.strip() + ' ' + a.strip()
                   for a, b in zip(*[iter(names.split(','))] * 2)]

That works well most of the time, if I strip suffixes first and don't keep them.

asked 1 min ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 10 اسفند 1394 ساعت: 5:04

صفحه بندی