Zip an excel file and email using script.

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Zip an excel file and email using script.
# 1  
Old 02-20-2010
Zip an excel file and email using script.

Hi All,

Currently i am using below script to attach excel and email from a Unix script.
uuencode ASC.xls|mailx -m -s "ABCD_subject`TZ=CST+24 date +%d-%b-%y`"

Can anyone give me or help me in zipping excel and sending that email as the excel is very heavy.

# 2  
Old 02-20-2010
gzip -c ASC.xls | uuencode ASC.xml.gz | mailx .....

# 3  
Old 02-20-2010
Thanks Much!!!

Please suggest on how to write body for the email above.
# 4  
Old 02-20-2010
I normally use something like:

cat << ! | mailx ......
Message body goes here
$(gzip -c ASC.xls | uuencode ASC.xls.gz)

# 5  
Old 02-20-2010
echo "Hi All" >> cnt
echo "" >> cnt
echo "" >> cnt
cat cnt | gzip -c ASC.xls | uuencode .........

I am using the above format but i am getting attchment but not the body in the email"HI ALL".

Last edited by Scott; 02-20-2010 at 02:06 PM.. Reason: Code tags
# 6  
Old 02-20-2010
All you've done here is compress your file cnt into a file called ASC.xls and sent that as an attachment. "HI ALL" is in the attachment!

That's not quite how I described it.
# 7  
Old 02-20-2010
cat << ! | mailx ......
Message body goes here
$(gzip -c ASC.xls | uuencode ASC.xls.gz)

Hi could you please describe the above code whats the (!) in the code ?

Last edited by Scott; 02-20-2010 at 03:45 PM.. Reason: Code tags please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Check Error File attach and email zip file

I need something to say if these two file extensions exist in this directory *err and *rpt zip up these files into one zip file and email them to me. If they don't exist wait 2 hours and check again.... Not sure how to determine if I need to do an if then statement or a while true or a for... (1 Reply)
Discussion started by: xgringo
1 Replies

2. Windows & DOS: Issues & Discussions

How to split the excel file into 3 files randaonly and zip them?

Hi , I have one excel file in zipped format which contains data with size 157 MB. It's original size is 2.6 GB so to send to user I zipped the file. Now user is saying unable to open the file at once because of huge size and want to split the excel file into 3 files randaonly and zip them.... (1 Reply)
Discussion started by: Maddy123
1 Replies

3. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

4. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

5. Shell Programming and Scripting

need to zip 2 GB file and send it via email

i want to zip the 2GB file and send it via email from unix machine using uuencode. could you please suggest whether it will possible or not and also command to do it. (3 Replies)
Discussion started by: mail2sant
3 Replies

6. Shell Programming and Scripting

Zip an excel in a shell script

I am getting an xls file in the dir errorpath. I would like to zip it. Kindly help me on this. The code is as below. sqllst=$errorpath/$run_pgm.${date_stamp}".xls" sqlstatus=$errorpath/$run_pgm"."${date_stamp}".sqlstatus" sqlscript=$binpath"/im_rpt.sql" (2 Replies)
Discussion started by: Nithin
2 Replies

7. Shell Programming and Scripting

zip and email files

Hi, New to Unix and trying to do something - I am trying to zip bunch of file and email - /sbin/sh If i use mail then I can not specify subject - uuencode | mail -s "testfile" Error is - mail: illegal option -- s If i use mailx then I can specify... (7 Replies)
Discussion started by: bhush782003
7 Replies

8. Shell Programming and Scripting

Help on email data file as excel from unix!!

Hi, I need to email a data in excel sheet from unix using shell scripting.I could able to generate the data file with tab delimiter with extension .xls could able to email it. The problem is when a coulmn with 16 digit number is exported, it is showing in scientific format. Any help in... (1 Reply)
Discussion started by: sparan_peddu
1 Replies

9. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip Archive: SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

10. UNIX for Dummies Questions & Answers

zip and email a file

I am trying to zip and email a .csv file from my unix box to myself and I get corrupt file. I have used the gzip to zip the file and I am using Winzip to try to unzip it. I'm not sure what I am doing wrong. Should I be using the zip command? (4 Replies)
Discussion started by: spalmarez
4 Replies
Login or Register to Ask a Question

Featured Tech Videos