weixin_44367761
一颗逗
采纳率0%
2019-01-19 23:30

linux下批量修改文件内容

>NODE_1713_length_83_cov_1.000000
CCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCTACCTCT

NODE_1714_length_78_cov_80895.000000
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
NODE_1715_length_78_cov_4750.000000
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
NODE_1716_length_78_cov_351.000000
TGCATCCGGGAGGATTCGAACCTCCGACCGCTCGGTTCGTAGCCGAGTACTCTATCCAGCTGAGCTACGGATGCATTG
NODE_1717_length_78_cov_351.000000
TTGCTCTTTAACAATCCGGAACAAGCTGAAAATTTGAAACGACACAGGGTCGCATTCTTCCGTAATAAAGAATGATGA
想批量删除编号后面的length和cov
即NODE_1713_length_83_cov_1.000000变成NODE_1713

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • zhangPC zhangPC 2年前

    sed -i "s/(NODE_[0-9]+).*/\1/" file

    点赞 评论 复制链接分享
  • mikey_lw mikey_lw 2年前

    可以使用python写一个简单的脚本。

    点赞 评论 复制链接分享

相关推荐