I have a document open in notepad++ that is one very long string (or several very long strings). I'd like to be able to automatically "shape" the document, so that it inserts line breaks (\n or \r\n) just before the word wrap line (about 80 chars) without chopping words in two pieces. I have scoured the web, and search as much as I could on the notepad++ UI and web site. I have found no solution to this.
Could anyone help me find a way to insert line breaks at the word wrap line?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had to fool around to find this method:
Adjust the window so that wrapping to it gives the line length you want. Select the text to be wrapped. Turn off the word-wrapping display function so that only the front part of lines display. Use "Split lines" on the Edit menu.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem with this is that the "wrap" will not split a "word". I need to insert <CR><LF> to create lines of exactly 80 characters. How can I do this? The "word-wrap/Split lines" method described by you will not split a "word" in he middle. I have also played around with TextFX plug-in's "Rewrap Text to (Clipboard or 72) width" function, but it removes multiple occurances of blanks and this is unacceptable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In that case you may try using a Regular Expression Find/Replace action.
If it's not a problem for your computer (memory) and Notepad++, you could first remove all newline characters to create a single line.
Then, you would replace the search expression (.{80}) by \1\r\n throughout that line.
It will leave you with all lines without possibly (probably) the last one consisting of 80 characters exactly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What I mean is, first set a line length and then apply the split lines (as rshaw22 was indicating).
Changing the window size should not be needed with an elegant solution.
Best rgds,
-Geert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a document open in notepad++ that is one very long string (or several very long strings). I'd like to be able to automatically "shape" the document, so that it inserts line breaks (\n or \r\n) just before the word wrap line (about 80 chars) without chopping words in two pieces. I have scoured the web, and search as much as I could on the notepad++ UI and web site. I have found no solution to this.
Could anyone help me find a way to insert line breaks at the word wrap line?
I had to fool around to find this method:
Adjust the window so that wrapping to it gives the line length you want. Select the text to be wrapped. Turn off the word-wrapping display function so that only the front part of lines display. Use "Split lines" on the Edit menu.
The problem with this is that the "wrap" will not split a "word". I need to insert <CR><LF> to create lines of exactly 80 characters. How can I do this? The "word-wrap/Split lines" method described by you will not split a "word" in he middle. I have also played around with TextFX plug-in's "Rewrap Text to (Clipboard or 72) width" function, but it removes multiple occurances of blanks and this is unacceptable.
In that case you may try using a Regular Expression Find/Replace action.
If it's not a problem for your computer (memory) and Notepad++, you could first remove all newline characters to create a single line.
Then, you would replace the search expression (.{80}) by \1\r\n throughout that line.
It will leave you with all lines without possibly (probably) the last one consisting of 80 characters exactly.
I'm also interested in having that feature. Any chance it's already currently possible and if so, how to do that?
If not present yet, can this be a future feature?
Best rgds,
-Geert
Forgot to clearly mention:
What I mean is, first set a line length and then apply the split lines (as rshaw22 was indicating).
Changing the window size should not be needed with an elegant solution.
Best rgds,
-Geert