11

I have a list of data in notepad and want to insert a space in the beginning of each line.

Example

This is how it looks in the notepad now

Number

"123"

"123"

"124"

"126"

"147"

I want it to look like below

    Number

    "123"

    "123"

    "124"

    "126"

    "147"

I am sure there is some short cut. Please advice.

mbomb007
  • 3,788
  • 3
  • 39
  • 68
ppp
  • 111
  • 1
  • 1
  • 3
  • 1
    found a similar question on superuser [find and replace](http://superuser.com/questions/637476/using-wildcard-search-replace-in-notepad) – Felix Castor Dec 29 '14 at 21:38

3 Answers3

22

Open your file in Notepad++

Press Ctrl+H to open the Replace window.

Change the "Search Mode" to Regular expression.

In the "Find what" box, type (\n|^)

In the "Replace with" box, type \1     (with your spaces or tab at the end)

Then click "Replace All"

Note: If you want tabs instead of spaces, a tab character can be typed with Alt+09

mbomb007
  • 3,788
  • 3
  • 39
  • 68
  • @FilippoG If you're adding code on SO, simply select the code and click the button that looks like `{}`. SO will add the spaces for you. – mbomb007 Jul 24 '18 at 15:46
1

This is for notepad pre-installed with ubuntu:

1.Select the lines you want to indent

2.click tab

That's all!

Sophile
  • 287
  • 3
  • 16
0

Press Alt and select the line no. move curser till the line no you want to have space . Now you can enter spaces as many you want or anything and save it.