WinSCP and Notepad++ Line Breaks

Advertisement

Guest

WinSCP and Notepad++ Line Breaks

I've been using SmartFTP for who knows how long because it's been free and easy to use. I'd been too lazy to look into anything else. Now that it's NOT free, I switched to WinSCP. I added Notepad++ as an external editor.

My PHP looks like this in Notepad, Notepad++, whatever text editor you want:
Line 1
Line 2
Line 3
...
When I open a file straight from the remote browser in WinSCP, it looks like this:
Line 1

Line 2

Line 3

...
Is there a way to fix the ridiculous abundance of line breaks?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: WinSCP and Notepad++ Line Breaks

How do you open the file from remote browser? Double-click? Explicit open? Explicit edit? If double-click, what is your configured on-double-click action? Edit/Open? In what editor/application does the file open? What protocol are you using?

Reply with quote

Guest

It opens like that regardless of how I open it. Double click/open/edit. In the options I set Notepad++ as the default editor. Protocol is standard FTP.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Unfortunately I'm not able to reproduce the problem.

Few more questions:
What version of WinsCP are you using?
Do you know why EOL does the file stored on server have? If not, can you download the file to local machine (make sure to use binary transfer mode), ZIP it and mail it to me?
Do you have editor option Force text transfer mode... enabled or disabled for Notepad++?

Reply with quote

OldDart
Guest

Added 0x0d to each text line

I have upgraded from 4.0.0 to both 4.1.5 and 4.1.6.

In version 4.0.0 the data transferred OK between 2 x Win32 PC's, with both the source Text File and the Destination Text file being the same size.

Using both 4.1.5 and 4.1.6 I end up with a different size Text file at the destination and have found that every CR+LF has been changed to CR+CR+LF.

I hope this helps and I will change back to Vn 4.0.0 - Good product thanks for allowing me to use it.

cheers
Will Beattie aka Oldfart

Reply with quote

Advertisement

OldFart
Guest

Hi There,

I think I have found the option to make everything a "Binary" transfer and it is now working correctly.

WinSCP -> Login -> Preferences -> Preferences Button -> Transfer -> Binary (archives, doc).

Cheers
Will Beattie aka OldFart

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Added 0x0d to each text line

OldDart wrote:

In version 4.0.0 the data transferred OK between 2 x Win32 PC's, with both the source Text File and the Destination Text file being the same size.

Using both 4.1.5 and 4.1.6 I end up with a different size Text file at the destination and have found that every CR+LF has been changed to CR+CR+LF.
What protocol are you using? There has been change to handling of ascii transfers in 4.1.1 with FTP protocol. If you are connecting to Windows server, make sure you set Window EOL characters on Environment tab.

Reply with quote

Guest

I was the original poster of this topic, and I'd like to say that changing the transfer mode to binary fixed the problem.

I am currently using 4.1.6

My server is Linux-based, and the files are UTF-8.

I'm really glad I got around to checking this topic again. I haven't had the time lately to deal with this until now. I really like everything else about WinSCP.

Reply with quote

tazosmr
Joined:
Posts:
2

My only SOLUTION:
  1. Open file (For example, I use Notepad++)
  2. Open "Find and Replace" window (check "Extended" under "Search Mode"), then type \r\n in first line, and \n in the second and click "Replace all" and SAVE.
From now, they may be opened normally.

Reply with quote

Advertisement

Guest

I am using 'UTF-8' instead of 'Latin' as default encoding in the editors preferences, that seems resolve the problems for me.

Reply with quote

Ricardo
Donor
Ricardo avatar
Joined:
Posts:
107

@tazosmr: Other than you're posting in a very old topic, what you said is basically a conversion of EOL(end of line) from Windows format to Unix. This can be done automatically from Edit menu/EOL Conversion inside Np++.

Reply with quote

Knocks
Joined:
Posts:
2

Since this issue is still relevant in 2015, I am replying to this thread with the same screenshot that I posted in the other thread (both threads are at the top of Google's search results for this issue).

Uncheck this box to fix the issue.

COCFuGu.png

Reply with quote

Advertisement

You can post new topics in this forum