Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing a string with empty line

Tags:

vim

vi

sed

I have a file which has 2000 lines of data (file name is data.tsv). I want to replace the string with empty line where there is a matching pattern, in my case is PMC:

How can I do with Vim or other sed command?

Thanks,

Rio

like image 671
Rio mario Avatar asked Apr 27 '26 05:04

Rio mario


1 Answers

With vim you can do it like this:

:g/PMC:/normal S
like image 103
yolenoyer Avatar answered Apr 29 '26 00:04

yolenoyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!