Sponsored Content
Top Forums Shell Programming and Scripting Trying to send an excel spreadsheet. Post 302316194 by NycUnxer on Thursday 14th of May 2009 10:40:54 AM
Old 05-14-2009
Trying to send an excel spreadsheet.

And I have to modify this part of the script, I'm not sure what to change the content-type to for this to work, or what else I would need to change here:

Code:
# This script sends Email  acoording to command line arguments.
# $1 - file to be attached (full path with name)
# $2 - file name as it shows on Email (can be any name)
# $3 - recipient list (separated by commas)
# $4,$5,$6,$7 - Subject (up to 4 words)

   echo "Subject: $4 $5 $6 $7"  > alerts
   echo "TO: $3" >> alerts
   echo "Content-type: multipart/mixed; \
boundary=\"Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)\"" >> alerts
echo "\nThis is a multi-part message in MIME format.\n" >> alerts
echo "--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)" >> alerts
echo "Content-type: text/plain; charset-iso-8859-1" >> alerts
echo "Content-transfer-encoding: 7BIT\n" >> alerts
   date >> alerts
   echo "\nDO NOT REPLY TO THIS EMAIL" >> alerts
if [ "$1" = NO ] ; then
        :
else
echo "\n--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)" >> alerts
echo "Content-type: text/plain; name=$2" >> alerts
echo "Content-transfer-encoding: 7BIT" >> alerts
echo "Content-disposition: attachment; filename=$2\n" >> alerts
cat $1 >> alerts
fi
echo "\n--Boundary_(ID_mO+hZOEtmqFT2u66ThY4xw)--" >> alerts

Please suggest what to change so I can mail the excel spreadsheet. Thanks again.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is it possible to import a Unix directory into an Excel spreadsheet

Does anyone know if it's possible to import a Unix directory into an Excel spreadsheet? I'm trying to create a report based on about several thousand files within a Unix server directory, I was thinking if I could import the directory into a spreadsheet it would be easier to sort the data based... (2 Replies)
Discussion started by: Arkitech
2 Replies

2. Shell Programming and Scripting

Send email with attachment in form of excel in unix

Hi, I have a shell script which send email with an attachment in the form of an email. However, the when I open the attachment, all the data comes in one column. How do I format the data in the excel sheet while sending the email? Thanks (8 Replies)
Discussion started by: bdebroy
8 Replies

3. UNIX for Dummies Questions & Answers

Download to unix/linux from excel spreadsheet

Hi all, I am not a computer programmer nor a computer specialist but I do create some Excel speadsheets and I need to download the data generated from Excel to a Unix/linux programmed screen. Do you know if there is a way or a "trick" that could make this data transfer automated so it would... (2 Replies)
Discussion started by: claude73
2 Replies

4. Shell Programming and Scripting

How to send a repost as a Excel file...?

Hi All, Have a file in solairs and want to send it as a Excel file...! Yes i getting it as .csv file...! but it's not looking gud.. how i can add colos into it..? Generate report in Excel, with color and it should look good..! (1 Reply)
Discussion started by: bullz26
1 Replies

5. Shell Programming and Scripting

How to convert the data into excel sheet and send mail using 'mailx' command

Hi all I have a shell script that uses a stored proc to generate output from some tables and send the same in an e-mail using mailx command. Now I need to convert the output to excel format and send e-mail. How can I achieve this. Please help me in this regard, as it's very urgent and I have been... (5 Replies)
Discussion started by: sanbabu
5 Replies

6. Shell Programming and Scripting

UNIX -> send data as excel in seperate cells

Hi I have a data file in UNIX as follows. I need to send this file in Mail as excel format. but the problem i face is i get the data all in single cells per row. what can i do to get the data in seperate cells. File -> attachment.xls data data data data data1 data1 ... (1 Reply)
Discussion started by: vj8436
1 Replies

7. AIX

Trying to send an excel spreadsheet.

I may have posted in the wrong section, either way I need some help. And I have to modify this part of the script, I'm not sure what to change the content-type to for this to work, or what else I would need to change here: # This script sends Email acoording to command line arguments. #... (1 Reply)
Discussion started by: NycUnxer
1 Replies

8. Programming

extract the same format from existing excel file using " Spreadsheet::ParseExcel " module

Hi , can any one tell me,"How to extract the same format from existing excel file to new excel file " using Spreadsheet::WriteExcel or Spreadsheet::ParseExcel module ??? Example_pgm: Below program is used to read existing excel file..In this program "my $cell = $_;" line is used to... (0 Replies)
Discussion started by: kavi.mogu
0 Replies

9. 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

10. Shell Programming and Scripting

UNIX - how to send attach excel in mail

Hi Experts, i need your help here :confused: Need to send a report thru mail using unix shell script(AIX). can you help me to do this? . i tried "uuencode" with CSV format, but while reading report all values are in single column. i need each column values in separate cell. Thanks in... (9 Replies)
Discussion started by: newbieabc
9 Replies
PSC(1)							      General Commands Manual							    PSC(1)

NAME
psc - prepare sc files SYNOPSIS
psc [-fLkrSPv] [-s cell] [-R n] [-C n] [-n n] [-d c] DESCRIPTION
Psc is used to prepare data for input to the spreadsheet calculator sc(1). It accepts normal ascii data on standard input. Standard out- put is a sc file. With no options, psc starts the spreadsheet in cell A0. Strings are right justified. All data on a line is entered on the same row; new input lines cause the output row number to increment by one. The default delimiters are tab and space. The column for- mats are set to one larger than the number of columns required to hold the largest value in the column. OPTIONS
-f Omit column width calculations. This option is for preparing data to be merged with an existing spreadsheet. If the option is not specified, the column widths calculated for the data read by psc will override those already set in the existing spreadsheet. -L Left justify strings. -k Keep all delimiters. This option causes the output cell to change on each new delimiter encountered in the input stream. The default action is to condense multiple delimiters to one, so that the cell only changes once per input data item. -r Output the data by row first then column. For input consisting of a single column, this option will result in output of one row with multiple columns instead of a single column spreadsheet. -s cell Start the top left corner of the spreadsheet in cell. For example, -s B33 will arrange the output data so that the spreadsheet starts in column B, row 33. -R n Increment by n on each new output row. -C n Increment by n on each new output column. -n n Output n rows before advancing to the next column. This option is used when the input is arranged in a single column and the spreadsheet is to have multiple columns, each of which is to be length n. -d c Use the single character c as the delimiter between input fields. -P Plain numbers only. A field is a number only when there is no imbedded [-+eE]. -S All numbers are strings. -v Print the version of psc SEE ALSO
sc(1) AUTHOR
Robert Bond PSC 7.16 19 September 2002 PSC(1)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy