Extraction of .gz file using 7zip fails

Hi,

My target is to send a file created by Unix process to myself as an excel file. So I have used the below commands to achieve it.

tr -d '\t' < PROGRAM_CREATED_FILE | sed -e 's/\\//g' | awk 'BEGIN{FS=">"; OFS="\t"} '{$1=$1}1' > file.xls
gzip -9 file.xls
echo "test mail" | sendxchange -a "file.xls.gz" -s "Report" my_mail_id

After receiving the file on my mail box, I save it in Windows machine. I try to extract the archive using 7zip. It attempts to extract and says Data error in file.xls. File is broken

Need help on this.

Thanks

The compatibility of compression when transferring data between different operating systems always needs to be tested and never taken for granted.

What Unix OS is it? What version of Windows is it?

I assume that you have tested the processing of the data by transferring a file (by whatever means, FTP, USB stick, whatever) to ensure compatibility of the uncompressed file and you know that works?

So then you want to compress the data to improve speed. From experience I have found that often just using the 'compress' command on Unix (again depending which version), transferring that to Windows, and then using the vanilla unzip often works.

My advice is that if the decompression operation fails try a different utility. Looking at your post, have you tried 'winrar' to unzip the file? If that doesn't work try another unzip utility.

So no stock answer I'm afraid. Just keep testing until you find compatibility.

I identified the error I guess :D. The issue was the transfer mode.

I found this out when I was testing with FTP. I am using a HP-UX Unix server and Windows XP machine.

While transferring, I changed transfer mode to ascii to binary and then it worked. Now I am trying to do the same on mail.

What about uuencode ? can you tell me how to use that with sendexchange ?

With FTP, unless you are transferring text files, always use binary mode.