【发布时间】:2020-09-08 23:02:31
【问题描述】:
我经常得到包含 1000 个公司名称的 excel 文件,我需要在我们的系统中匹配这些文件以获取他们的内部 ID 和其他指标,有没有一种简单的方法来进行这种清理
我的示例初始列表
Dash Network Inc.
Presto LLC
Blue origin, Inc.
我需要这样的输出,以便我可以在数据库中执行
UPPER(CMP_NM) LIKE 'DASH%NETWORK%'
OR UPPER(CMP_NM) LIKE 'PRESTO%'
OR UPPER(CMP_NM) LIKE 'BLUE%ORIGIN%'
我执行以下步骤,请问有什么简单的方法。
(1) convert the list to upper
(2) remove INC or LLC
(3) find and replace spaces with %
(4) find in regular expression (.+) and replace with '\1%' --> for before and after single quotes with %
【问题讨论】: