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.
Asked
Active
Viewed 2,431 times
0
-
Would probably be easier just to run it through a Python script. – Carcigenicate Apr 06 '17 at 16:16
-
How exactly do I do that? – Patrice Andala Apr 06 '17 at 16:22
-
Do you know Python? – Carcigenicate Apr 06 '17 at 16:23
-
Possible duplicate of [Learning Regular Expressions](http://stackoverflow.com/questions/4736/learning-regular-expressions) – Wiktor Stribiżew Apr 06 '17 at 16:24
-
just `sed -r '/.{6}/d' mylist.txt > newlist.txt` – Michael D. Apr 06 '17 at 16:37
-
I'm not really familiar with Python – Patrice Andala Apr 06 '17 at 16:44
3 Answers
2
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...)

F.Igor
- 4,119
- 1
- 18
- 26
-
Totally worked, though can you please elaborate the "extended" mode part. I still have the empty lines – Patrice Andala Apr 06 '17 at 16:34
-
-
-
Yes, @Toto. When adding `\R` to the initial expression you don't need the second step. – F.Igor Apr 06 '17 at 17:03
2
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

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

VB Did Nothing Wrong
- 375
- 2
- 15