Sublime Forum

How delete all lines texts without word after a specific value?

#1

Hello,

I’m trying delete specific lines, but I’ve trying so much tutorials but none has worked for me.

My texts are like this:

example01@example.com|example1
exple002@example.com|example0
example03@example.com|
example04@example.com|123
example05@example.com|
example06@example.com|

In this caso, my specific value is " | “.
I want delete all lines texts without word/number after the “|”, (example0#@example.com|)”.
And result final will be:

example01@example.com|example1
exple002@example.com|example0
example04@example.com|123

So, how i can do it in Sublime Text 3?

I hope that you’re understanded my doubt.

Thank you everyone!

(Sorry for my bad English)

0 Likes

#2

sounds like a simple regex find and replace will do the job

  1. open the Find and Replace panel
  2. ensure the Regular expression option is ticked
  3. Find What: ^[^|]+\|(?!\w).*\n?
  4. Replace With:
  5. i.e. leave Replace With blank
  6. Replace All
4 Likes