nobo
nobo

Reputation: 125

Removing lines with less than 10 characters

I work under Windows, I'm trying to clean a text I'd like to study, what's the right regex in Notepad++ to remove lines which are <= 10-character-sized.

Upvotes: 4

Views: 9351

Answers (2)

Om Sao
Om Sao

Reputation: 7663

Step.1) Replace all the lines containing less than or equal to 10 chars with empty string. ^.{0,10}$ enter image description here

Step.2) Now you have lots of empty lines. So, remove empty lines: Remove Empty Lines "Edit" > "Line Operations" > "Remove Empty Lines"

Upvotes: 0

Bohemian
Bohemian

Reputation: 425208

Search:

^.{0,9}((\r?\n)|$)

Replace with a blank (ie nothing)

Upvotes: 8

Related Questions