Gilles Criton
Gilles Criton

Reputation: 781

Delete all lines that have a specific word in Pycharm

Using Pycharm, I want to delete all lines that have a specific word. Does someone know how we can do that?

Upvotes: 2

Views: 957

Answers (2)

Mahesh patil
Mahesh patil

Reputation: 1

Search the particular word (Ctrl+F) and Ctrl+Alt+Shift+J select the whole line using arrow then delete.

enter image description here

Upvotes: 0

Pavel Karateev
Pavel Karateev

Reputation: 8610

Use replace feature with regex (e.g. ^.*hello.*$\n) to match the whole line (and \n) containing a word and replace it with nothing:

enter image description here

Upvotes: 4

Related Questions