Insert 2 lines after every 5th occurence of string
Posted: Mon Nov 28, 2016 3:57 am
I have a text file with 15000 rows (See sample below)
How can I insert 2 lines after every 5th instance of the word "ENTER"
I need to insert the a new line with the word "ENTER" and a second line with the string "DELAY 35000"
Thanks
How can I insert 2 lines after every 5th instance of the word "ENTER"
I need to insert the a new line with the word "ENTER" and a second line with the string "DELAY 35000"
Thanks
- DELAY 5000
CODE: 1234
ENTER
DELAY 500
CODE: 0000
ENTER
DELAY 500
CODE: 1111
ENTER
DELAY 500
CODE: 2580
ENTER
DELAY 500
CODE: 1212
ENTER
DELAY 500
CODE: 5555
ENTER
DELAY 500
CODE: 2222
ENTER
DELAY 5000
CODE: 1234
ENTER
DELAY 500
CODE: 0000
ENTER
DELAY 500
CODE: 1111
ENTER
DELAY 500
CODE: 2580
ENTER
DELAY 500
CODE: 1212
ENTER
DELAY 500
CODE: 5555
ENTER
DELAY 500
CODE: 2222
ENTER