Page 1 of 2

txt file contains ^M when it get transferred to linux server

Posted: Wed Jul 22, 2020 11:30 am
by gracelim
hi,

we are transferring txt file from windows 2003 to linux server daily using bestsync 2019.
there are instances the txt file , after being transferred to linux contains ^M in every line. but in windows, the original file does not does.

so in bestsync 2019 , we set sftp to send it in ASCII mode instead of binary but even after doing so, it still happens from time to time.

how shall we go about it to resolve the issue?

Re: txt file contains ^M when it get transferred to linux server

Posted: Wed Jul 22, 2020 1:49 pm
by RiseFly
Cause of this problem:
File has been transferred between systems of different types with different newline conventions.
Windows-based text editors will have a special carriage return character (CR+LF) at the end of lines to denote a line return or newline, which will be displayed incorrectly in Linux (^M). Often times, this is because the file is created or perhaps even edited on a Microsoft Windows machine and then uploaded or transferred to a Linux server. This typically occurs when a file is transferred from MS-DOS (or MS-Windows) without ASCII or text mode.
https://support.microfocus.com/kb/doc.php?id=7014821

Select "ASCII mode" in "Transfer Mode" tab of the "Advanced Settings" of the FTP folder in BestSync can resolve this problem.

Re: txt file contains ^M when it get transferred to linux server

Posted: Thu Jul 23, 2020 2:16 am
by gracelim
we done that and we still encounter the problem from time to time

how can we go about it?

Re: txt file contains ^M when it get transferred to linux server

Posted: Thu Jul 23, 2020 4:44 am
by RiseFly
May be this files were uploaded to Linux by binary mode before, please try to use BestSync to upload those file again.
You can changed the synchronization action in the Task Preview of BestSync, by this way you can force the files to be uploaded to the server again.

Re: txt file contains ^M when it get transferred to linux server

Posted: Thu Jul 23, 2020 9:12 am
by gracelim
we did that. and it sometimes still occurs. does this means bestsync it not consistently using ascii mode even it is already set ?
the task is scheduled to generate the file and send to the linux server every 15 mins.

Re: txt file contains ^M when it get transferred to linux server

Posted: Thu Jul 23, 2020 11:43 am
by Nanditisaine
Great share!

Re: txt file contains ^M when it get transferred to linux server

Posted: Fri Jul 24, 2020 2:13 am
by gracelim
hi ,

aside from ^M, we also encounter an empty in row some in the middle of the file even though the source does not have it.

Re: txt file contains ^M when it get transferred to linux server

Posted: Fri Aug 14, 2020 7:00 am
by gracelim
any updates

Re: txt file contains ^M when it get transferred to linux server

Posted: Fri Aug 14, 2020 3:05 pm
by gracelim
is this a bestsync bug ?

Re: txt file contains ^M when it get transferred to linux server

Posted: Fri Aug 14, 2020 3:24 pm
by RiseFly
We have confirmed this issue on BestSync 2020 Ver15.0.1.8, it worked fine.
Please try the new version to see if the problem has been resolved.