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

Postby gracelim » Wed Jul 22, 2020 11:30 am

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: 1031
Joined: Tue Nov 03, 2009 2:51 pm

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

Postby RiseFly » Wed Jul 22, 2020 1:49 pm

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

Postby gracelim » Thu Jul 23, 2020 2:16 am

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

how can we go about it?

RiseFly
Site Admin
Posts: 1031
Joined: Tue Nov 03, 2009 2:51 pm

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

Postby RiseFly » Thu Jul 23, 2020 4:44 am

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

Postby gracelim » Thu Jul 23, 2020 9:12 am

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

Postby Nanditisaine » Thu Jul 23, 2020 11:43 am

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

Postby gracelim » Fri Jul 24, 2020 2:13 am

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

Postby gracelim » Fri Aug 14, 2020 7:00 am

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

Postby gracelim » Fri Aug 14, 2020 3:05 pm

is this a bestsync bug ?

RiseFly
Site Admin
Posts: 1031
Joined: Tue Nov 03, 2009 2:51 pm

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

Postby RiseFly » Fri Aug 14, 2020 3:24 pm

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.


Return to “BestSync Support Forum”

Who is online

Users browsing this forum: No registered users and 6 guests

cron