I have a big file and I want to remove all the lines that have the word date
For example:
{
date: 10291992
stuff: stuff
...
},
{
date: 02171995
stuff: stuff
...
},
...
So I want to remove all the lines that contains the word date
but since each date has a different date, I can't just ctrl f and replace it. I was reading that putting ^.*
in the front but it didn't work for me.
I'm currently using Sublime Text 3.
Thanks.
All you need to do is open the Find dialog (Find -> Find...
), search for date
, hit Find All to select all instances of your search pattern, then select Selection -> Expand Selection to Line
. Hit Delete and you're all done.
I tried to follow the accepted answer but found it wasn't working for me: the Expand Selection to Line
button was not expanding the selection for all the matched lines.
What did work, though, was to switch to regular expression mode (the *.
button on the left of the Find menu) and do a search for
\n.+date.+
replacing it with an empty string. This removes the entire line (i.e., doesn't leave an empty line in its place).
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