How to add a space in front of every line in notepad
Asked Answered
Z

3

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.

Zoospore answered 29/12, 2014 at 21:34 Comment(1)
found a similar question on superuser find and replacePlethoric
B
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

Bibulous answered 31/12, 2014 at 19:21 Comment(1)
@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.Bibulous
S
1

This is for notepad pre-installed with ubuntu:

1.Select the lines you want to indent

2.click tab

That's all!

Scrannel answered 18/3, 2023 at 14:19 Comment(0)
B
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.

Broca answered 27/5, 2022 at 12:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.