Sending Email in Excel Format

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Sending Email in Excel Format
# 1  
Old 04-13-2017
Sending Email in Excel Format

Hello,
I am trying to send an email with the below attachment in .xls file format by default its opening everything in a single column in the email. How to display the column in a separate column in excel instead everything together.


Code:
2017/01/01 a 10
2017/01/01 b 20
2017/01/01 c 40
2017/01/01 a 60
2017/01/01 b 50
2017/01/01 c 40


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 04-13-2017 at 06:34 PM.. Reason: Added CODE tags.
# 2  
Old 04-13-2017
I suspect you're not doing what you think you are. Show your code please.
# 3  
Old 04-13-2017
That's not an e-mail issue but more like EXCEL. Open the file with the "text agent" or "text wizard" and select space as the column separator.
# 4  
Old 04-13-2017
Code:
$ cat test
2017/01/01 a 10
2017/01/01 b 20
2017/01/01 c 40
2017/01/01 a 60
2017/01/01 b 50
2017/01/01 c 40
$echo | mailx  -s "Test Email" -a test xyz@xyz.com


Moderator's Comments:
Mod Comment SERIOUSLY: Please use CODE tags as required by forum rules!

Last edited by RudiC; 04-13-2017 at 06:35 PM.. Reason: Added CODE tags.
# 5  
Old 04-13-2017
That is not XLS, nor CSV, it's not even TXT as Windows understands it.

Try changing spaces to commas, adding carriage returns, and renaming it 'test.csv' so it will actually open in excel.

Code:
awk -v OFS="," '{ $1=$1 ; print $0 "\r" }' test > test.csv
mailx -s "Test Email" -a test.csv xyz@xyz.com

# 6  
Old 04-13-2017
I am getting blank line after each line. How to get rid of that one?

---------- Post updated at 05:22 PM ---------- Previous update was at 04:58 PM ----------

It worked fine after removing the carriage return.
# 7  
Old 04-13-2017
Your input file must have had carriage returns in the first place. Oh well.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sending Excel Files as attachment using Mail

Hie, I need to attach an .xlsx file as an attachment to a mail. I have used the mail option but i dont think there is anything for attachment. Can you show me how else can i do it? I am not allowed to install mutt since it is a workplace and they have their restrictions. And its a Bash Shell (2 Replies)
Discussion started by: barryallen
2 Replies

2. Shell Programming and Scripting

Body content is in random format while sending email from Linux to my outlook.

Hi I have a script running in lunix machine which emails log file content to my outlook. Here is the actual log file result: Image-1 In-Master:25028 ReplicaDn Consumer Supplier Delay dc=xxx,dc=com lmjker0110:12345 ... (4 Replies)
Discussion started by: buzzme
4 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

Format Excel sheet

Hi, I want to format Excel sheet through Unix script. Format would mean bolding the data in the cell, adding clor to it etc. Please help me if it is possible through Unix scripting? Thanks, Durga (2 Replies)
Discussion started by: Durga Prasad NK
2 Replies

5. Shell Programming and Scripting

mailx not sending excel attachment properly

Hi, I am trying to send email with attachment using mailx command. I am using the folowing command: uuencode XX_HWSW_BUYERWISE_88963631_1.xls XX_HWSW_BUYERWISE_88963631_1.xls | mailx -s "Test Mail as Attachment" oracleams@xyz.com I get the email in the inbox. However, when I try to open the... (5 Replies)
Discussion started by: asp_julius
5 Replies

6. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

7. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

8. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

9. Shell Programming and Scripting

Sending SQL Queries output to different Excel sheets

Hi, I need your help in sedning sql queries output to different excel sheets. My requirement is like this: Query1: Select name from table1 where status = 'Complete' Query2: Select name from table1 where status = 'Failed' Query3: Select name from table1 where status = 'Ignored' ... (4 Replies)
Discussion started by: parvathi_rd
4 Replies

10. Shell Programming and Scripting

Problem sending excel attachments with MIME::Lite in perl

I am running a perl script that generates an excel doc and then emails it as an attachment. I can generate the excel file fine. I can scp it from the box and open it with no problems. When I send it over email, the file does open properly. The file in email is only 288 B, but on the server it is... (1 Reply)
Discussion started by: Mike_the_Man
1 Replies
Login or Register to Ask a Question