我有一个csv文件,其中A列含多个词,文件格式如下:
我将这多个词定义了优先级为:Before > After > Causes > Caused > Is Condition > Conditional > Subject 2 produces the target。
(1)当A列中含[Before, Causes, Is Condition, Subject 2 produces the target]其中一个词时,在A列前加一列,该列填充值为所包含的这个词,其余列数据不变。如图中的第4行应该变为:
(2)当A列中含[After, Caused, Conditional]其中一个词时,将After替换为“Before”,“Caused”替换为“Causes ”,“Conditional”替换为“Is Condition”,同时将BC列的数据调换,DE列的数据调换。在A列前加一列的填充值为替换后的词,其余的数据不变。如图中的第5行:
处理这种数据对与我来说太难了,感谢各位的帮忙!感激不尽!
我将这多个词定义了优先级为:Before > After > Causes > Caused > Is Condition > Conditional > Subject 2 produces the target。
(1)当A列中含[Before, Causes, Is Condition, Subject 2 produces the target]其中一个词时,在A列前加一列,该列填充值为所包含的这个词,其余列数据不变。如图中的第4行应该变为:
(2)当A列中含[After, Caused, Conditional]其中一个词时,将After替换为“Before”,“Caused”替换为“Causes ”,“Conditional”替换为“Is Condition”,同时将BC列的数据调换,DE列的数据调换。在A列前加一列的填充值为替换后的词,其余的数据不变。如图中的第5行:
处理这种数据对与我来说太难了,感谢各位的帮忙!感激不尽!