How to avoid CR after compression

Hi all,
I am having few files which needs to be concted into a single file and then it is compressed and FTPed from the UNIX server to the Windows server.

For the above purpose i am using gzip command to compress the files after concetenation.
And i am FTP ing the compressed file in the binary mode.
Thus transfered file contains a carriage feed(CR) inserted for every new line. I want to avoid this CR and it should be a new line itself.

I doubt that the presence of CR is due to the compression (When i tried to FTP the concated file without compressing there is no CR inserted for a new line.The output is as desired)

Could any one suggest me a way to avoid the CR which is inserted as a result of compression?
Or is there any command other than gzip and compress inorder to compress the files without a CR?

Any help is greatly appreciated.

Windows stores text files with a CR/LF pair as line terminator while Unix based systems use a LF.
Convert the files before you compress them with the tool unix2dos. If it's not available on your system you can use awk:

awk '{printf "%s\r\n", $0}' unixfile > tempfile
mv tempfile > unixfile

Regards

Thanks for your efforts Franklin.
Now the output file contains a new line inserted as well as a CR at the end oof the statement.
Kindly help me :frowning:

Statement? What statement?

You should be able to read a converted text file in notepad or another windows text editor if the lines are terminated with a CR/LF pair.