2番目のフィールドに単語を含む.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,
ベストアンサー1
sed
2番目のフィールドに含まれる行を使用して削除するには、content
次の手順を実行します。
sed '/^[^,]*,[^,]*content/d' infile
または、2番目のフィールドの行を削除してください。星そしてcontent
:
sed '/^[^,]*,content/d' infile