![]() ![]() Using ‘Plain Text’ search mode will not work. Note that we are using the ‘Extended’ search mode for the replacements. Deleting blank linesĪ quick way to delete blank lines from a file using Notepad++ is to use the ‘Search-Replace’ functionality of the editor as shown below. Our main job here is to know how to quickly delete those annoying blank lines. There is a wonderful history behind the newline character, which Wikipedia explains quite nicely. The following images shows the EOL markers for Windows and Unix.Īs you can see Windows files are terminated by the sequence CR+LF (\r\n) and Unix by LF(\n) character. In Notepad++ we can see the EOL markers with the ‘View->Show Symbol->Show End of Line’ menu. I regularly use Notepad++ for editing purposes. Even though you may be using Windows, most host servers are Linux based, and so transferring files back and forth from these servers can create these kind of problems. If you think you don’t use *nix systems and are therefore free from these problems then you are wrong. Unfortunately the actual codes representing the newline differ across operating systems, which creates problems such as the above when exchanging data between systems. As we all know, it is a special character or sequence of characters signifying the end of a line of text. This was all caused by the non standard newline character, also known as a line break or end-of-line (EOL) character. At one point an ‘if’ construct in one of my PHP code was about 60 lines away from the next starting brace. During the whole ordeal the source files kept adding a huge number of blank lines. ![]() During the last few weeks I’ve been shuttling php and html files from various host servers and my PC. Blank lines are an eye sore for source files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |