Help with changing view of single line
-
I have a file that is all in one line.
*Aabce *A123456789 *AABC3DFG …
I want to be able to edit it in the following format
*Aabcde
*A123456789
*AABCDEFGI only want the view to change not anything of substance in the file.
-
Maybe try:
Open the Replace dialog by pressing Ctrl+h and then set up the following search parameters:
Find what box:
\x20\*
Replace with box:\r\n*
Search mode radiobutton: Regular expression
Wrap around checkbox: ticked
. matches newline checkbox: doesn’t matter (because the Find what box doesn’t use.
)
Option checkboxes not mentioned are typically not important to the operation, but should in general be unticked.Then press the Replace All button.
-
@Raul-Alvarez said in Help with changing view of single line:
I only want the view to change not anything of substance in the file.
Do like @Alan-Kilborn suggested but do NOT save the file,
otherwise you have changed it. -
Hmmm…text editing 101… :-)
-
@Raul-Alvarez said in Help with changing view of single line:
I only want the view to change not anything of substance in the file
In essence it would appear you want the editor to recognize 1 (or more) characters as equating to a carriage return/line feed and then display along those lines. I’ve never seen this before although a couple of ideas come to mind. One might not be possible, I’ve not dealt with the language settings but given my age I grew up with punch cards which had a fixed width. Maybe someone can answer as to whether a UDL (user defined language) can be made to a max of ?? columns. This would still only be an approximate, and I don’t know if it even alters the viewing of an existing file.
Another idea I had was to use the clone view and then size that window to somewhat approximate the average length of any string. To do this you have the file open in NPP. Then on the tab denoting the file, right click and select “clone to other view”. You will now have 2 equal sized windows within NPP. Move the border between them so in one view it gets narrow to approximate your requirement. You may also need to adjust the word wrap option within Preferences, then select Editing (left side) and change option to “default”. You can make either left or right view be the narrow one so as to show roughly how you’d like the text to view. You can edit and in the alternate view the changes will also appear.
my 2c worth
Terry -
I forgot to add, the view was must be set with “word wrap” enabled otherwise both views will ONLY show as one line leading off “into the sunset”. This is under the View Menu, select word wrap.
Terry
-
If the OP really wants an “alternate view” of the file, I think the true answer might be to use a script to capture the opening/closing events. The opening even could do the replacement operation I provided earlier and the closing/saving event could put the data all back on one line. I’m keeping this rather vague because the OP was rather vague about the whole thing.