Sublime Forum

Removing empty lines - that gets inserted automatically

#1

ST 2 sometimes expand a (html) file with empty lines between every code line. Could not figure out under which circomstances it would do that.

Is there a command or a way to remove empty lines from a file?

Thanks

0 Likes

#2

Might not be ST2’s fault, could be borked line-endings.

Did you get this file from a machine running on a different operating system? Like perhaps your webserver via FTP?

We had a developer at my last place who was using some weirdo-FTP client and it kept trying to ‘fix’ line endings when going from a Windows box up to the linux server. Resulted in the same as what you have.

I’m sure there’s a plugin that will remove blank lines (Notepad++ has one) but it won’t fix the cause of the problem if I’m right.

Good luck

0 Likes

#3

Thanks for the push in the right direction.

Yes, the files are coming over ftp (TotalCommander). I’ll investigate further on that.

Appreciate the help.

0 Likes

#4

Just to complete this:

The additional lines are added when the FTP client’s transfer mode is set to ‘Text’ instead to 'Binary".

0 Likes