Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

nooneinparticular

script to remove control M from files that Windows editors add to the end of every line

#!/bin/ksh
if [ "$1" = "" ]
then echo ""
echo "Parm 1 FileName (required)"
echo ""
return
else FileName="$1"
fi
cat ${FileName} | sed 's/.$//g' > ${FileName}.txt
chmod 770 ${FileName}.txt
mv ${FileName}.txt ${FileName}
Devendra Narvariya

Re: CTRL+M char issue, WINSCP 4.3.5

martin wrote:

Devendra Narvariya wrote:

I checked the files on Windows XP with various editors but CTRL+M character is not shown. But after file transfer those CTRL+M character appears when I use VI editor.

Have you tried some binary viewer?


No. The editors I tried on Windows XP were Notepad,Notepad++,Windows 2003 office, WordPad.
martin

Re: CTRL+M char issue, WINSCP 4.3.5

Devendra Narvariya wrote:

I checked the files on Windows XP with various editors but CTRL+M character is not shown. But after file transfer those CTRL+M character appears when I use VI editor.

Have you tried some binary viewer?
Devendra Narvariya

Re: CTRL+M char issue, WINSCP 4.3.5

martin wrote:

Devendra Narvariya wrote:

When I transfer any file from windows to my AIX server CTRL+M character is displayed in every editable file when opened with VI editor. ALso such file do not get executed because of presence of this character, why CTRl+M character pops up while transferring the file. Is there any reason for this or its just a BUG.

Is the character present in the source file? Depending on that, do you want WinSCP to transfer file intact (i.e. you believe WinSCP is adding the character [this is unlikely])? Or do you want WinSCP to strip the character when uploading? For that see:
https://winscp.net/eng/docs/transfer_mode


I checked the files on Windows XP with various editors but CTRL+M character is not shown. But after file transfer those CTRL+M character appears when I use VI editor.


Regards

Devendra Narvariya
martin

Re: CTRL+M char issue, WINSCP 4.3.5

Devendra Narvariya wrote:

When I transfer any file from windows to my AIX server CTRL+M character is displayed in every editable file when opened with VI editor. ALso such file do not get executed because of presence of this character, why CTRl+M character pops up while transferring the file. Is there any reason for this or its just a BUG.

Is the character present in the source file? Depending on that, do you want WinSCP to transfer file intact (i.e. you believe WinSCP is adding the character [this is unlikely])? Or do you want WinSCP to strip the character when uploading? For that see:
https://winscp.net/eng/docs/transfer_mode
Devendra Narvariya

CTRL+M char issue, WINSCP 4.3.5

When I transfer any file from windows to my AIX server CTRL+M character is displayed in every editable file when opened with VI editor. ALso such file do not get executed because of presence of this character, why CTRl+M character pops up while transferring the file. Is there any reason for this or its just a BUG.
sindy12

My, version 4.1.beta works in a right way :wink:
alfp

Re: unix -> windows text transfer dropping embedded Ctrl-M

mikew wrote:

martin wrote:

This has been fixed in 4.1 beta.


This is still happening for me. version 4.1.7


I have just re-tested my original case with SFTP protocol using both versions 4.1.6 & 4.1.7, and the Ctrl-M is not being dropped. Which protocol are you using?

Alf.
mikew

Re: unix -> windows text transfer dropping embedded Ctrl-M

martin wrote:

This has been fixed in 4.1 beta.


This is still happening for me. version 4.1.7
martin

Re: unix -> windows text transfer dropping embedded Ctrl-M

This has been fixed in 4.1 beta.
ransue

Re: unix -> windows text transfer dropping embedded Ctrl-M

martin wrote:

This has been fixed already. See tracker entry.


I get a "You do not have permission to access this document." from that page. Can you explain how to set up so ^Ms are not showing up on the unix side? I am on version 4.0.3 Build 345
Thx
martin

Re: unix -> windows text transfer dropping embedded Ctrl-M

This has been fixed already. See tracker entry.
alfp

unix -> windows text transfer dropping embedded Ctrl-M

When transferring a text file which contained an embedded Ctrl-M character not associated with any line terminator from unix to windows with SFTP protocol, the Ctrl-M character gets dropped. This does not occur when doing a text transfer on a similar file from windows to unix. I would have expected that Ctrl-M characters would only be stripped in a text transfer if associated with a line terminator, and then only for a transfer from windows to unix. Is this expected behaviour or is this a bug?

I am using WinSCP 4.0.6 (build 358) which I believe is the latest. I cannot verify if this also happens with FTP protocol as our unix hosts only accept SFTP connections.