2
有没有一种方法可以在数据行中搜索模式,然后将它们存储在新表的不同列中?例如,如果我需要从身体下面抽出量,钞票和硬币,你认为这是可能实现R上R中的文本挖掘搜索和提取信息
user_id | ts | body | address |
3633| 2016-09-29| A wallet with amount = $ 100 has been found with 4 bills and 5 coins| TEST |
4266| 2016-07-20| A purse having amount = $ 150 has been found with 40 bills and 15 coins| NAME |
7566| 2016-07-20| A pocket having amount = $ 200 has been found with 4 bills and 5 coins| HELLO |
期望的结果(这是期望的结果)
user_id | Amount | Bills| Coins|
3633 | $100 | 4 | 5|
4266 | $150 | 40 | 15|
7566 | $200 | 10 | 10|
是的,这是可能的。你会想要使用正则表达式。见'?regex'。对[此效果]有些东西(http://stackoverflow.com/questions/14159690/regex-grep-strings-containing-us-currency)。 –