我有一个100MB的文件,里面有这么多电子邮件,我想用bash shell删除不包含电子邮件的行如何使用bash-shell实现此操作?示例
BR,"",adriano-piassali,adriano piassali,""
"conceicao, sao paulo, BR","",adriano-name,name,""
"sorocaba, sao paulo, BR","",adriano-name,name,""
"BS, massachusetts, US","",adriano-name,name piris
"johannesburg, gauteng, ST","",adriano-name,name ,""
"ponta kak, name, BR","email@exmple.com",adriano-name,name,""
"BL, emilia-name, IT","",adriano-name,name,""
US,"",adriano-name-name,adriano name,""
我只想坐
"ponta kak, parana, BR","email@exmple.com",adriano-premebida,adriano,""
您只需将grep
与电子邮件正则表达式一起使用即可:
grep -Ei '([[:alnum:]_.-]+@[[:alnum:]_.-]+?.[[:alpha:].]{2,})' filenamehere