Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove all spaces from file in Notepad++?

How can I remove ALL whitescape in a file, using Notepad++?

Example data:

;;    ;;;2017-03-02;8.026944444;16.88583333;8.858888889
;;  ;   ;   ;   2017-03-03  ;   7.912777778 ;   16.88583333 ;   8.973055556
;;                  ;   ;   ;   2017-03-06  ;   7.954444444 ;   16.88583333 ;   8.931388889
;   ;   ;   ;   ;   2017-03-07  ;   7.926388889 ;   16.88583333 ;   8.959444444
;;;;;2017-03-05;8.984722222;16.98472222   ;8
like image 543
Anastasia_ Avatar asked Apr 21 '17 06:04

Anastasia_


People also ask

How do I remove spaces between numbers in notepad?

You tried: ^\s* , that is: "Any expression that starts with zero or more spaces". In your case, that won't match anything since this line starts with the [ character. Instead, try using \s* as expression. That will remove any spaces within your document.

How do I remove blank lines in notepad?

Remove blank lines (no whitespaces) First you need to open the file with Notepad++. Once the document is loaded, select Edit > Line Operations > Remove Empty Lines. Voilà, every single blank lines has been deleted.


3 Answers

To delete all spaces in the file, replace ' +' with '' (quotes only for demonstration, please remove them). You need to have the checkbox "Regular expression" checked.

To remove all spaces and tabs, replace '[ \t]+' with '' (remove quotes).

This works for big files, too, where the solution of @Learner will be tiresome.

like image 81
Pharaoh Avatar answered Oct 18 '22 20:10

Pharaoh


No need for regular expressions. In Find what add a whitespace character and then replace with nothing.

enter image description here

like image 32
Ogglas Avatar answered Oct 18 '22 22:10

Ogglas


Press Shift+Alt then press the down button before "56". Then backspace. You will see the cursor becomes big and then you can remove the spaces all at once.

like image 22
Ria Sen Avatar answered Oct 18 '22 21:10

Ria Sen