^M at the end of each line when I edit in winscp

Advertisement

g1967
Joined:
Posts:
2

^M at the end of each line when I edit in winscp

I frequently copy files from my unix enviroment to my winxp workstation, edit through Winscp using the open or edit function and then copy the files back to the unix server. When I do this I get a ^M at the end of each file when you display in unix. How can I edit these files in windows and winscp without having the ^M added to the end of each file?
Thanks,
Greg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Sorry, I am using version 4.0.3 build 345

If you are using an external editor, either:
1) Instruct it to use Unix line endings
2) or configure it as an external editor for WinSCP, use edit, not open, and check "force text transfer mode for files edited in external editor"

Reply with quote

Guest

It's not the editor

Hi,
I experience a similar problem. The ^M is added by WinSCP during the transfer, even without editing anything.

Just do this:
1) transfer a text file from Unix => Win
2) transfer it back from Win => Unix
3) edit the newly received file in Unix (i.e. using vi)

you will see the Windows' /n at the end of the line, and will have to do a 'dos2unix' for that file.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: It's not the editor

Anonymous wrote:

Just do this:
1) transfer a text file from Unix => Win
2) transfer it back from Win => Unix
3) edit the newly received file in Unix (i.e. using vi)

you will see the Windows' /n at the end of the line, and will have to do a 'dos2unix' for that file.
What transfer mode are you using? Text or binary? Have you used the same mode for download and upload? Had the file unix line endings originally (on unix side, before step 1)? What end-of-line characters have you configured on Environment tab of login dialog for your session?

Reply with quote

Advertisement

marrtins
Guest

Is it possible to specify transfer mode in FAR manager plugin? It`s really annoying when i get converted CR/LF<->LF and vice verse :evil:

Thnx!

Reply with quote

martin
Site Admin
martin avatar

marrtins wrote:

Is it possible to specify transfer mode in FAR manager plugin? It`s really annoying when i get converted CR/LF<->LF and vice verse :evil:
Sure. In plugin settings you can set default mode. On transfer options dialog, you can change mode for particular transfer.

Reply with quote

marrtins
Guest

No realy sure where to find that option, look here is `transfer settings` dialog in FAR manager


Here is `About` window

Reply with quote

martin
Site Admin
martin avatar

It can be set in plugin configuration since 1.6 only. But even in 1.5.1 you can set the transfer mode on the upload/download box.

Reply with quote

Advertisement

Amit85
Guest

At the time of transferring, if you ensure that your file is transferred in Text Format (by selecting option for text transfer mode), then we can avoid the ^M characters.

Reply with quote

Advertisement

You can post new topics in this forum