Using sed replace line in file with another file

后端 未结 4 1575
我寻月下人不归
我寻月下人不归 2021-01-21 08:04

I have a very large tab delimited file, I would like to replace a single line in this file with another. As the line has >100 columns, a simple sed \'s/find/replace/\' is not de

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 08:36

    From @Aaron

    sed "s/^.*find.*$/$(cat newline.txt)/" infile.txt
    

    Where find is a unique string in infile.txt that returns a single line, the line is then replaced by newline.txt

提交回复
热议问题