Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I repeat the line in notepad++?

Tags:

How can I repeat the line in notepad++ ?

For example I have the following input:

a 01 a 02 a 03 a 04 

And I would like it to become:

a 01 a 01 a 02 a 02 a 03 a 03 a 04 a 04 

So every line should be displayed twice.

like image 869
tahafahed Avatar asked Feb 03 '14 22:02

tahafahed


People also ask

How do I copy a row in Notepad++?

CTRL-D will duplicate the current row, in case you are meaning that with copy.

How do I Find and replace end of line in Notepad++?

In Notepad++, press Ctrl-H (Replace...). In the Replace dialog box, click Extended under Search Mode. In the "Find what" box type !\ r and in the "Replace with" box type \r.


2 Answers

If you don't mind the semi-manual process, you can start at the first line and repeat the following key combination until you reach the end of the document (you get very fast at this)

Ctrl + D Down Down

This duplicates the current line, then moves down twice (to the line following the newly duplicated one).

If you have a large document, you can record this once as a macro (see the Macro menu), then use either Ctrl + Shift + P (Playback) repeatedly -- you can just hold those keys down. Or use the Macro option "Run a Macro Multiple Times..."

like image 159
paddy Avatar answered Sep 20 '22 18:09

paddy


Open the search dialog box and write :-

Find:

^.*$

Replace:

$0\n$0

like image 27
Ravi Avatar answered Sep 17 '22 18:09

Ravi