如何删除.csv文件中第二个字段包含单词的行content
?
例子 :
ams-hbase-log4j,content:\n#LicensedtotheApacheSoftwareFoundation(ASF)underone\n#ormorecontributorlicenseagreements
ams-log4j,content:\n#\n#LicensedtotheApacheSoftwareFoundation(ASF)underone\n#ormorecontributorlicenseagreements.
ams-site,timeline.metrics.cache.size:150,
预期产量
ams-site,timeline.metrics.cache.size:150,
使用sed
和删除第二个字段包含的行content
,您可以执行以下操作:
sed '/^[^,]*,[^,]*content/d' infile
或以除去第二场中的行星级与content
:
sed '/^[^,]*,content/d' infile
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句