Question

I have a text file with the structure of:

  100167.0000000  100004.2656250      33.0000000
  100200.9062500  100083.2187500      30.0000000
  200867.9218750  100361.1406250      27.0000000
  200374.2500000  100778.3750000      24.0000000

I want to remove the blank space in the front of each line, using the notepad, or notepad++.

How Can I select the front blank space and delete it?

Remarks:

I just want to select the front space, not all the space. More example to make the question better:

What should I do If I want to select all the front space (across the line) using a mouse?

Was it helpful?

Solution 2

In Notepad++, set the "Regular expression" radio button and put this in the "Find what" box:

^\s*

And leave the "Replace with" box empty.

You'll have to read about "regular expressions" to get all the details, but for the above:

^  means only match at the beginning of the line
\s means match any whitespace char (including space and tab)
*  means to match zero or more of the preceeding

So, in English, it says "match zero or more whitespace chars at the beginning of the line".

OTHER TIPS

In Notepad++, to select the space only in multiple lines, we can use the alt button.

The procedures are:

  1. Put the cursor in the aimed location.
  2. Press and hold the alt button.
  3. Select the space in the multiple line.
  4. Delete the selected space.

Thank you.

NB. Some people prefer to use the term "Highlight" instead of "Select". In this case, both of them have the same meaning.

As far as I remember Notepad++ have "extended" replace option, so you can try to replace:

"\r\n  "

where, \r\n means new line and a few spaces in this line - to empty string (but of course without "" ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top