How do I add
Keyboard : E : KeyDown
DELAY : 1300
Keyboard : E : KeyUp
DELAY : 200
to every X line in a text document?
How do I add
Keyboard : E : KeyDown
DELAY : 1300
Keyboard : E : KeyUp
DELAY : 200
to every X line in a text document?
To insert a new line after every 9 rows, go to Search
> Replace
menu (shortcut CTRL+H) and do the following:
Find what:
(.*\r?\n){9}\K
Replace:
Your new line\n
Select radio button "Regular Expression"
Then press Replace All
You can test it at regex101.
\
or *
, you'll need to escape them with a backslash. \\
or \*
.
Jan 9, 2017 at 21:37
Still using search/replace, this worked better in my case: selects [your example 9 lines] in one group (the inner '()' pair for each line followed by 'newline'), then the '{}' pair for the look-ahead line count to grab, and the outer '()' pair for the 9 lines retained as a group
((.*\n){9})
Use the \1 variable to restore the same [9] line group, followed by [your sample line insert] and a newline
\1\nKeyboard : E : KeyDown DELAY : 1300 Keyboard : E : KeyUp DELAY : 200\n
I'm note sure if it works in Notepad++, but this is how I solved it with PSPads phReplace:
Search:
(.*\r\n.*\r\n.*\r\n.*\r\n.*\r\n.*\r\n.*\r\n.*\r\n)
Replace:
$1New Line[Enter]
[Enter]
stands for pressing the Enter-Button as phReplace does not allow \r\n
in replace field.