Topic "WinSCP and Notepad++ Line Breaks"

Author Message
Guest




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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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?
_________________
Martin Prikryl
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
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++?
_________________
Martin Prikryl
OldDart

Guest


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
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.
_________________
Martin Prikryl
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.
spiffyd

Guest


Changed it to binary transfer mode... line breaks are still happening when there should be none. This only started happening with the latest update...
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
spiffyd wrote:
Changed it to binary transfer mode... line breaks are still happening when there should be none. This only started happening with the latest update...

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
_________________
Martin Prikryl
tazosmr
[View user's profile]

Joined: 2014-07-09
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.
Guest




i am using 'UTF-8' instead of 'latin' as default encoding in the editors preferences, that seems resolve the problems for me.
Ricardo
[View user's profile]
Donor
Joined: 2006-02-03
Posts: 106
tazosmr wrote:
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.

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++.
Knocks
[View user's profile]

Joined: 2014-06-06
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:

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
See this link for a known interoperability issue with Pure-FTPD:
https://winscp.net/eng/docs/faq_line_breaks#known_issues
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License