Patrice Andala
Patrice Andala

Reputation: 194

How to delete words with more than six letters in notepad++

I have a long list of dictionary words in notepad++ and I am looking to shorten the list by deleting all words above six character. Is there any way I can do this. I have tried using multi-line editing but clearly this doesn't work because the word are too many.

Upvotes: 0

Views: 2772

Answers (3)

Toto
Toto

Reputation: 91488

This one do the job:

  • Ctrl+H
  • Find what: ^.{6,}\R
  • Replace with: EMPTY
  • Replace all

Explanation:

^               : begining of line
  .{6,}         : 6 or more any character
  \R            : any kind of linebreak

Upvotes: 2

F.Igor
F.Igor

Reputation: 4380

Use the replace window using:

  • Find what: .{6,1000} (6 to 1000 characters, or the number you want)
  • Replace with: (leave empty)
  • Search mode : Regular expression

All lines more than 6 characters will be emptied

Then you can delete empty lines:

  • Find what: \n\n
  • Replace with: \n
  • Search mode : Extended (\n \r...)

Upvotes: 2

VB Did Nothing Wrong
VB Did Nothing Wrong

Reputation: 385

You can use ctrl-h and tick regular expressions. Try finding: ^[A-Z|a-z]{6,}$ and replace with blank

enter image description here

Upvotes: 1

Related Questions