Hi,
i'm trying to insert a line break after every 2 lines using a macro in this file : http://rafb.net/p/d3AsCg64.nln.html
i execute it with the option "until the end of file" but it only works halfway. can you help with that ?
thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you are probably better off counting the line numbers and using that for the count of times the macro needs to be run. Its probably because the file gets larger as notepad++ is busy with the macro, so it ends too early
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got a solution using Simple Script that will work for this particular file or similar files, but it's not a general purpose solution. Fortunately, in this case the lines themselves have keys to identify which ones need an extra line break.
Note: You'll want to highlight the body of the page before running the script.
If you want to add a blank line after each of the "1 ML" style lines, use the following script:
NOTE: The "[EOL]" is just a marker. It stands for "End Of Line", but it doesn't mean anything to Simple Script itself; it's just a piece of text. It was just the first thing that popped into my head. Any other text that doesn't appear in the document would work just as well for a marker.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i'm trying to insert a line break after every 2 lines using a macro in this file :
http://rafb.net/p/d3AsCg64.nln.html
i execute it with the option "until the end of file" but it only works halfway. can you help with that ?
thanks.
I think you are probably better off counting the line numbers and using that for the count of times the macro needs to be run. Its probably because the file gets larger as notepad++ is busy with the macro, so it ends too early
Yes, that's correct. This incorrect behavior has been reported before.
Ver. 4.8 should fix the bug. That is, I submitted the bug-fix to Don, and he confirmed that it had been merged in the developmental version.
Regards.
Greg
Perhaps the macro would work if you start from the bottom, moving up and then run it "until the end of the file"?
thanks
Perhaps the Simple Script Plug-In will let you work around this problem in the most simple way.
I've got a solution using Simple Script that will work for this particular file or similar files, but it's not a general purpose solution. Fortunately, in this case the lines themselves have keys to identify which ones need an extra line break.
Note: You'll want to highlight the body of the page before running the script.
If you want to add a blank line after each of the "1 ML" style lines, use the following script:
replace("1 ML","1 ML[EOL]")
replace("1 MC","1 MC[EOL]")
replace("1 CA","1 CA[EOL]")
replace("1 CE","1 CE[EOL]")
replace("1 DV","1 DV[EOL]")
replace("1 ST","1 ST[EOL]")
replace("1 MT","1 MT[EOL]")
replace("[EOL]","\r\n")
If you want to add a blank line after the other lines instead, use the following script:
replace("1 ML","1 ML[EOL]")
replace("1 MC","1 MC[EOL]")
replace("1 CA","1 CA[EOL]")
replace("1 CE","1 CE[EOL]")
replace("1 DV","1 DV[EOL]")
replace("1 ST","1 ST[EOL]")
replace("1 MT","1 MT[EOL]")
replace("\r\n","\r\n\r\n")
replace("[EOL]\r\n","")
NOTE: The "[EOL]" is just a marker. It stands for "End Of Line", but it doesn't mean anything to Simple Script itself; it's just a piece of text. It was just the first thing that popped into my head. Any other text that doesn't appear in the document would work just as well for a marker.
thanks again.
i hope the bug is fixed soon