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

Welcome to BestSync Support Forum!
If you have any questions, comments, concerns, suggestion, please summit here, we'll try to reply you in short time.
Thank you!
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post 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?
RiseFly
Site Admin
Posts: 1077
Joined: Tue Nov 03, 2009 2:51 pm

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

Post 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.
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post by gracelim »

we done that and we still encounter the problem from time to time

how can we go about it?
RiseFly
Site Admin
Posts: 1077
Joined: Tue Nov 03, 2009 2:51 pm

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

Post 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.
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post 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.
Nanditisaine
Posts: 1
Joined: Thu Jul 23, 2020 11:31 am
Contact:

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

Post by Nanditisaine »

Great share!
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post 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.
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post by gracelim »

any updates
gracelim
Posts: 65
Joined: Fri Mar 17, 2017 4:18 am

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

Post by gracelim »

is this a bestsync bug ?
RiseFly
Site Admin
Posts: 1077
Joined: Tue Nov 03, 2009 2:51 pm

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

Post 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.
Post Reply