how to add more then 1024 new lines at once?
-
@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.