1

I have a file in Notepad++ that has 200,000 rows and each row needs to be a certain length (2500). However I know some rows are shorter or longer than that. How can I find out how many rows are breaking this rule and which rows those are?

Destroy666
  • 12,350
MIGUEL
  • 11
  • 3

2 Answers2

3

You can use a regex search like this to find and/or count all the incorrect lines:

^.{0,2499}$|^.{2501,}$

It basically finds lines with 0 to 2499 of any characters (.), ^ marks the start and $ the end of line. The 2nd alternative finds lines with at least 2501 characters.

Make sure that . matches newline option is deselected.

Destroy666
  • 12,350
0

Another way is to find lines that don't have 2500 character :

  • Find What: ^(?!.{2500}$).+

Explanation:

^           # beginning of line
  (?!         # negative lookahead, make sure we haven't
    .{2500}     # 2500 any characters
    $           # until end of line
  )           # end lookahead
  .+          # match the whole line
Toto
  • 19,304