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 desirable. My newline is stored in file newline.txt
How do I achieve:
sed 's/find/newline.txt/' infile
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With