Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find lines not starting with " in Notepad++

I try to verify a CSV file where we had problems with line breaks.

I want to find all lines not starting with a ".

I am trying with /!^"/gim but the ! negation is not working.

How can I negate /^"/gim properly?

like image 358
Daniel W. Avatar asked Jan 16 '14 14:01

Daniel W.


People also ask

How do you search multiple lines in Notepad?

Notepad++ Search Across Multiple Lines Find Next Result: Search text: This is my file and I want to search some text across multiple lines. To search across lines, you will need to use a regex across multiple lines based on the below file types, Windows: \r\n.

How do I use the Find tool in Notepad?

In most programs, the Find and Replace option can be accessed by pressing the Ctrl + H or Ctrl + F keyboard shortcut on the PC. On Apple computers running macOS, the shortcut key may be either Command + H or Command + F . Replacing text within Notepad.


1 Answers

In regex, the ! does not mean negation; instead, you want to negate a character set with [^"]. The brackets, [], denote a character set and if it starts with a ^ that means "not this character set".

So, if you wanted to match things that are not double-quotes, you would use [^"]; if you don't want to match any quotes, you could use [^"'], etc.

With Notepad++, you should be able to search with the following to find lines that don't start with the " character:

^[^"] 

If you want to highlight the full line, use:

^[^"].* 
like image 103
newfurniturey Avatar answered Sep 18 '22 15:09

newfurniturey