I'm a little late to the party, but I seem to be missing something in
your post.
You say "Notepad++ inexplicably keeps adding blank lines." When and
where are you seeing the extra lines? I use several text editors
including Notepad++, and there are basically two (somewhat related)
causes for extra lines, but clarifying what is happening needs to happen
before you can understand and correct it.
I assume you are editing the source document in NP++, and then opening
it elsewhere (destination document) to reveal the extra blank lines. So
the first question is what's the difference in document environments?
eg:
source
- NP++ (w/o extra lines)
- on your desktop
- using Windows XP
- saved in Windows format.
destination
- vi editor
- on a remote computer
- using a *nix operating system.
or
destination
- web page (html document)
- on a *nix operating system
- ???
(I think HTML would "self correct", because it wraps when needed or when
told to via tags like </p> or <br>)
Analyze the source and destination environment to determine their
differences. Then apply the tips you have been given, like the
different line endings (NP++ -> edit -> EOL conversion -> ??? format).
Most text editors read the file and display them correctly regardless
which line endings are used, they just decide if it's Windows/DOS, UNIX,
or Mac format (based on EOL). This may confuse the user, because the
editor is quietly making adjustments without the user noticing.
You should also consider the document encoding involved (UTF-8, etc.). I
have had similar experiences (extra lines) when opening in other
programs, or when cutting and pasting between documents using different
encoding.
I really appreciate the interest from you and others. I haven't been
been paying enough attention to say with any certainty where the problem
is occurring. I am editing text files with notepad++. uploading them to
a linux server. I am using a CMS which has its own text editor so I may
have made and saved small changes through the CMS 'Edit Theme' tab. I
might then ftp it back to my windows desktop to make more serious edits
where it could be opened by default in Windows Notepad and now in Gedit
which I downloaded as a possible replacement. Confusing.
Now here's a thing. I have retrieved a CSS file from the server. It has
no line breaks in it, one long line. I go through it in notepad++
hitting the return key (385 times) where I want a line break and by
going VIEW - SHOW SYMBOLS - SHOW ALL I can see CR[in a box] (Carriage
Return?) at the end of each line. I save it and open it in Windows
Notepad and it has no line breaks, the CR symbols have become unknown
ascii characters like rectangles and it's all on one line again. I would
paste some of it here but when I paste the text the rectangles become
line breaks again (in a thunderbird email) so you would see nothing odd.
At this point I notice that a previous version of my file with SHOW
SYMBOLS on has the symbols at the line end denoted by CR LF[in a box]
not just CR and this one displays perfectly well in Notepad. I then find
one of the files which has been given double spacing and look at the
symbols at the line ends: It looks like every instance of [CR] has had
[CR][LF] added to it so that each line ends in [CR][CR][LF] hence the
double spacing, but only in Notepad++ and not in Windows Notepad.
Anyway, my css file - I upload it back up to the server, open it in the
CMS editor and all 385 line breaks have disappeared. I download it back
to the desktop, open it and look for the Symbols and they are all gone.
Holey Moley! Lucky I changed the file name.
A little more investigation and your hint above and I find a command in
Notepad++ called EOL Conversion which changes the end of line symbols
from [CR] to [LF] to [CR][LF] and names them MAC, UNIX and Windows
format, which is wierd because I am getting Mac line endings and I have
never been near a MAC
Confused? So am I. I am finding it difficult to see any sense or meaning
in this episode and hard to draw any useful lesson from it. A bit like
the rest of life really and like the rest of life I will just have to
deal with the apparently random difficulties that are put in my way with
whatever whatever method comes to hand and hope I am not storing up
difficulty for the future.
I may not be around much for a few days so apologies to anyone expecting
a reply. The help I have had here ahs been really valuable and I am much
obliged to you all.
Tim w