使用关键字列表挑选行

时间:2018-01-08 05:05:37

标签: python file

我有两个文件如下。从文件1和文件2,我需要创建一个字典。

档案1

procedure            code
anand database      321-87
Guy shiva network   321-123
jana audit          321-56

文件2

kalai has a recruitment group
shiva is the network guy in my office
he is the auditor in my audit office
anand is the database here
i bought a new phone and 1 kg of apple

要求

我需要从文件2中选择包含文件2(procedure列)中每行的所有关键字的行,如果文件2中的行包含所有关键字,则将其映射到该代码关注选择过程的关键字。

预期输出

S.No      procedure                          code
1    shiva is the network guy in my office  321-123
2    anand is the database here             321-87
3    i bought a red color apple             321-10

任何人都可以帮助我吗?

0 个答案:

没有答案