Using sed replace line in file with another file

后端 未结 4 1582
我寻月下人不归
我寻月下人不归 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:52

    With GNU sed:

    Find line in file file.csv which contains find, append content (r) of file newline.txt and delete (d) line which contains find:

    sed -e '/find/{r newline.txt' -e 'd}' file.csv
    

提交回复
热议问题