0
votes

I'm having a weird trouble for quite some time.

I use Filezilla as FTP agent and Aptana Studio as IDE. In some servers, when I upload/download files, it breaks all formating.

I tried both Binary and ASCII (though i know for .php and text files, ASCII is right), but the files keeps coming back like this:

Note those weird blank lines. If i open in Notepad it is even worse!

In some cases, even in notepad it opens really weird; like in one line only. If I delete those blank lines by hand, sometimes the code don't even work, but sometimes it does.

I've made plenty of research here and over the web, but besides putting on ASCII mode in FTP, I got nothing usefull =/

1
Why do you mention Apatana - has that got anything to do with it? Have you tried taking that out of the picture? What about using "cat -vet your file" before and after FTPing it and seeing what the differences are? And does one server always do one particular thing reproducibly? Do different servers do different things? What are we supposed to see in the listing? - Mark Setchell
sure i did, sir, i tried to open in notepad, and even (as this is a wordpress site) copiying from wp editor and pasting in notepad, and it looks like this. The original file has no empty lines. none. - user1576978
Oh, this happens only in some server, i didn't notice a pattern though - user1576978

1 Answers

0
votes

So, I'm still not 100% sure WHY this happens, (apparently some osX setups x Windows configs... old story, same players), but here's how I fixed:

Search and replace with regex:

At Sublime Text, just ctrl+h and click the Regular Expression icon (The first on the left, like the Sum Symbol)

Find What: [\r\n]{2,} Replace With: \n

Replace All, and you're done.