Problem while Transferring files to UNIX server

Hi

When I m transferring my file to UNIX server using filezilla , after every line in a file ^M is shown.

Because of this ^M I cannot execute my file/scripts
Why so ???

Any suggestions...

what is the transfer mode?

select that as binary mode for transfer or you will have to strip the control characters ( ^M ) at the destination

I think you mean vice versa, no? : select ascii transfer mode, not binary.

Hello

I ve tried it with both the modes i.e Binary as well as ASCII

^M is still there

I can remove it manually then my file/script is working ... However few files have more than 10000 lines. In such cases ,I cannot do it manually ...

Any help ???

Hi, you can use:

tr -d '\r' < dosfile > unixfile

or check out dos2unix if it is available on your system.

I wonder why it isn't working with ftp. Did you transfer a zipped file?

try using the command which will move the Control characters..
sed 's/.$//' oldfilename >newfilename .

Hope this should work.

Thanks Everyone !!! :b::D:cool::wink:

udhayashankar solution worked for me...:b::cool:

Scrutinizer : I m trying to FTP simple DAT file. I don't know what is the exact reason behind it coz sometimes these characters(^M) appears and sometimes not after successful transfer.:confused:

HAPPY NEW YEAR TO ALL THE USERS OF UNIX.COM:smiley:

or

dos2unix yourfile

cheers,
Devaraj Takhellambam