how to add more then 1024 new lines at once?
-
You could record a macro that inserts ONE line-ending, save it and name it, suggest “Insert a Line-Ending”.
Then use the Run a Macro Multiple Times command and specify that you want to run it 3000 times:For all this see the Macro top-level menu.
Alternatively, to do it all in a single step, without having to invoke the Run a macro box, you could make a macro that inserts 3000 line-endings, and tie that to a keycombo for easy repetitive use.
-
@Alan-Kilborn said in how to add more then 1024 new lines at once?:
you could make a macro that inserts 3000 line-endings
Note that I’m not suggesting recording that many manual presses of the Enter key! I’m suggesting to take the macro that inserts ONE and hand-edit
shortcuts.xml
to do a copy+multiple-paste change of the text of the macro, into a different, appropriately named macro. -
@Alan-Kilborn
i tried, recorded search and replace of $ and \n
then run… still running, close to an hour
(300 lines),didn’t understand what to copy/paste
-
@B-MR said in how to add more then 1024 new lines at once?:
i tried, recorded search and replace of $ and \n
Why would you do that?
Who said to do that?
Ok, well maybe I wasn’t super clear.Here’s how macro recording would go:
- start macro recording
- in editor window, press the Enter key once
- stop macro recording
- save macro
-
@B-MR ,
Use math and exponential growth to your advantage. Since you said “about 3000”, I will take you at your word, and assume that 3375 = 15³ is a reasonable approximation of 3000.
- Macro > Start Recording
- FIND =
\$
, REPLACE =¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
, ☑ Wrap Around, SEARCH MODE = regular expression, REPLACE ALL- this will replace every dollar sign with 15 pilcrows
- FIND =
¶
, REPLACE =¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
, ☑ Wrap Around, SEARCH MODE = regular expression, REPLACE ALL- this will replace every pilcrow with 15 pilcrows: so now we’re up to 15²=225
¶
for every original$
- this will replace every pilcrow with 15 pilcrows: so now we’re up to 15²=225
- FIND =
¶
, REPLACE =¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
, ☑ Wrap Around, SEARCH MODE = regular expression, REPLACE ALL- this will replace every pilcrow with 15 pilcrows: so now we’re up to 15³=3375
¶
for every original$
- this will replace every pilcrow with 15 pilcrows: so now we’re up to 15³=3375
- FIND =
¶
, REPLACE =\r\n
(I assume you want windows line ending, and either misunderstood\n
or mistyped when you wrote\n\n
originally; if I am wrong, use\n
as your replacement instead), ☑ Wrap Around, SEARCH MODE = regular expression, REPLACE ALL- this will replace each of the 3375
¶
into a newline sequence - so, in the end, you have 3375 newlines for each
$
in your original
- this will replace each of the 3375
- Macro > Stop Recording
- Macro > Save Current Recorded Macro
Playing back this macro will replace every
$
with 3375 newline sequences.If you want exactly 3000, you can break it up differently: for example, do 20 in the first replacement, 15 in the second, and 10 in the third. This is when middle-school “factor these numbers” will help you in real life (your math teacher was right after all).
----
On re-reading, maybe you wanted every EOL to be converted into “about 3000”. In which case, step two should search for$
instead of\$
. Sorry if I misunderstood. -
@PeterJones
it worked, thanks!alan, i understood what you clarify but i didn’t find what to copy in the xml file
<Macro name="newline" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2451" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> </Macro>
-
@B-MR said in how to add more then 1024 new lines at once?:
i didn’t find what to copy in the xml file
What you can do is go to this line:
<Action type="1" message="2170" wParam="0" lParam="0" sParam="
" />
and select the


part. Then hold down Ctrl+d for a bit to duplicate that part many times. Then select the whole line and do an in-selection Count (see Find tab of Find window) on000A
. That will tell you how many lines would get inserted when the macro runs. If you don’t have enough, copy and paste some more copies of

until you have what you want.Obviously borrowing (somewhat) from the Peter technique, if the Count reports that you have 500, copying what you have and pasting five times would get you to 3000. Use the Count function when you think you are done just to be sure you’re accurate.
-
Hello @b-mr, @peterjones, @alan-kilborn and All,
@b-mr :
So, folowing the @peterjones’s idea, as
3,000 = 20 × 15 × 10
, here is the way to insert exactly3,000
line-breaks, with a macro :
- If you’re using Windows files with the indication
Windows (CR LF)
in the status bar, insert the following macro in the<Macros>
node of your activeshortcut.xml
file :
<Macro name="Insert and Select 3,000 WINDOWS Line-Breaks" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="0" message="2303" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>
- If you’re using Unix files, with the indication
Unix (LF)
in the status bar, insert the following macro in the<Macros>
node of your activeshortcut.xml
file :
<Macro name="Insert and Select 3,000 UNIX Line-Breaks" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="0" message="2303" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).+" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0$0$0$0$0$0$0$0$0$0" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>
Best Regards,
guy038
- If you’re using Windows files with the indication
-
Solution #4, or is it #5?
New file
Keeping your eye on line number in the middle of the status bar (or left margin if you enabled line num display in Prefs… Margins…), hold down ENTER until you reach line 101. Takes about 5 seconds. If you overshoot, hit backspace a few times.
Blinking cursor is now at line 101.
ctl-a to Select all
ctl-c to Copy to clipcursor down once (originally omitted, added with an edit)
hold down ctl-v to paste repeatedly until line num is 3001. If you overshoot, hit ctl-z a few times.
Whole job takes about 15 seconds.
(edit: and 50*60 or 60*50 would be even faster)
-
I think the OP was truly looking for a “one step” solution, and you neglected stating recording a macro as part of your instructions. So I tried your instructions while macro-recording, and yes, indeed, they worked when playing back – sometimes things don’t always work when recording, but this time they did!
-
@Alan-Kilborn
sorry for the late response,<Macro name="new" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2451" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="













" /> </Macro>
i try a few copies first… it only add 3 lines…
guy038
didn’t work for meneil
i need it to apply on 300 lines, and it’s not practical to do it manuallyand also… correct me if i’m wrong, but did all the macros above apply to one line only?
i need it to apply in all the line in the filethanks for bearing with me
-
@B-MR said in how to add more then 1024 new lines at once?:
all the macros above apply to one line only
Well, not “all”, as mine did every line, ad you said it worked for you.
Think of the others as learning exercises, and see if you can extend them to work on all lines. (For example, down-arrow cursor movements can be recorded, so if you add that to a single-line macro, and then run that macro N times, where N is the number of lines in your file, then it should work. But get creative, and see if you can find alternatives)
-
@B-MR said in how to add more then 1024 new lines at once?:
i try a few copies first… it only add 3 lines…
Hmm, I tried it and it added the correct number of lines…
-
@B-MR said in how to add more then 1024 new lines at once?:
it’s not practical to do it manually
After you create the 3k empty lines in a new file, something you do once, you have all kinds of freedom.
You can Select All, Copy, then change tabs to your working file, and paste the 3k lines anywhere you want.
You can create a macro that does all kinds of things, including a pasting action. If clipboard is preloaded with the 3k lines, and the macro does not disturb the clipboard, there are many possibilities, including Find operations combined with paste operations, and, running the macro repeatedly as per Alan’s first post.
You can save the 3k lines file to 3kLines.txt (etc) and have it on hand for reuse if this insertion process you are now attempting is something you expect to be doing often.
It’s possible I (we?) don’t really understand your need. You have said very little about the file you are starting with, and what it should look like after the process.
(Edit: oops, I repeated stuff Peter already said. And I agree with him that you need to show some creativity now that you have all these building blocks.)
-
everybody…
i trust everything you said and tried is right…
don’t know why it doesn’t working for me,
anyway…
for the meantime i’ll stick with peter solutionthank you all!
-
Hi, @b-mr,
You said :
guy038
didn’t work for meSo, I re-tried my macro and it worked as expected : it correctly inserted
3,000
empty lines, containing only the two chars\r\n
!Don’t know why it didn’t work on your configuration ? Probably, you did not insert the macro within the right
shortcuts.xml
file !Best REgards,
guy038
-
Your macro inserts 3000 newlines, plus maybe some other stuff (depending on where the cursor is) from one original line. (We’ll come back to that.)
But, as the poster said in one of the replies,
i need it to apply on 300 lines
Your macro only inserts the characters once. (Even before this, the original question involved searching for
$
, which is the end of each line in the file. That’s why I made my original solution do the replacement for every newline in the file – well, really, my original was for every literal dollar-sign, because I wasn’t thinking straight… but I corrected that in my postscript.)So the OP would have to manually run your macro 300 times to add 3000 newlines after each of the 300 lines in the file. My macro converts every newline in the file to ~3000 newlines in one run.
I said in this post,
plus maybe some other stuff … (We’ll come back to that.)
Start with the file
one
Put the cursor between the
o
and then
and run your macro: there are 3000 lines ofo
followed byne
Undo. Put the cursor after the
e
. Run your macro. There are now 3000 lines ofone
followed by one blank line (if there was already a newline after theone
)Undo. Put the cursor before the
o
. This is the only position that makes 3000 empty lines. But it puts the empty lines beforeone
. The original statement, by regex searching for$
, originally implied that the desire was to make this change at the end of the line, not the beginning.And, as I said earlier, the desire was for every EOL in the file to become 3000 newlines instead, which yours does not do in a single run.
And as I said to @B-MR , if you added a “down arrow” to the end of the macro (
<Action type="0" message="2300" wParam="0" lParam="0" sParam="" />
), saved the shortcuts file, restart notepad++: now given the fileone two three
If you put the cursor before the
t
oftwo
, and use Macro > Run a Macro Multiple Times, choose theInsert and Select 3,000 WINDOWS Line-Breaks
from the pulldown list, and then choose Run until the end of the file
If you do that, then the end result will be
one
followed by 3000 blank lines, thentwo
followed by 3000 blank lines, thenthree
followed by 3000 blank lines. -
@PeterJones Maybe the following is a useful clarifying remark to your solution. Because I did not know the word “pilcrow”, I googled it and found that it is the technical term for “paragraph sign” (¶). I presume that more non-native speakers of English besides myself don’t know it. One can enter the symbol by hitting alt-20 (2 and 0 on the numeric keypad while keeping alt pressed).
-
@Paul-Wormer said in how to add more then 1024 new lines at once?:
Maybe the following is a useful clarifying remark to your solution. Because I did not know the word “pilcrow”…
I don’t know that knowing the definition of the word is all that clarifying in regards to inserting a given number of blank lines.
Perhaps more clarifying would be knowing why Peter used the pilcrow character in the first place. He did this because he wanted to use a character that is unlikely to be an existing character in a user’s document. This is so the replacement operations don’t accidentally hit characters that aren’t part of the solution proposed.
-
@Paul-Wormer said in how to add more then 1024 new lines at once?:
@PeterJones Maybe the following is a useful clarifying remark to your solution. Because I did not know the word “pilcrow”, I googled it and found that it is the technical term for “paragraph sign” (¶). I presume that more non-native speakers of English besides myself don’t know it. One can enter the symbol by hitting alt-20 (2 and 0 on the numeric keypad while keeping alt pressed).
I’m sorry. I thought in context, where I had 15 ¶ symbols in the replacement, followed by the description that the replacement put in 15 pilcrow symbols, that it would correlate the ¶ symbol with the word “pilcrow”, even if as a non-native or native English speaker you did not know that technical term.
Also, one can get the “pilcrow” / “paragraph sign” by copy/pasting the exact sequences I used in my post. (I personally have windows builtin
charmap.exe
as one of my saved Notepad++ Run-menu entries so that I can easily run the charmap to find fancy characters while typing in Notepad++… and I have a script set up in PythonScript that will convert sequences like\0xXXXX
or\u+XXXX
into the unicode character at the hex codepoint XXXX.