Error message while openning the xls file generated by UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error message while openning the xls file generated by UNIX
# 1  
Old 01-12-2017
Error message while openning the xls file generated by UNIX

Hi All,

I have created a unix script to mail the xls file.This is being done using mailx command

Code:
fdate=`tail -1 abc.xls | cut -c1-8`
SUBJECT="CARD GL Exceptions : ${ENV} for ${fdate}"
destname=CARD_GL_Exceptions_$fdate
sed 's/#BUSINESS/BUSINESS/1' abc.xls > abc2.xls
mv abc2.xls abc.xls
line_count=`wc -l abc.xls|awk '{print $1}'`
echo $line_count
if [ $line_count -gt 1 ]
then
(echo "Hi,
Please find  attached.
Regards";uuencode abc.xls $destname.xls) | /usr/bin/mailx -s  "${SUBJECT}"  ${TO} ${CC}

Everything is working fine except the fact that am getting an error messgae every time i open the file

Error Message : "The file you are trying to open is in a different format than specified by the file extension.Verify that file is not corrupted and is from a trusted source.Doyou want to open the file"

I have to click on yes every time .I need to get rid of this error message.Kindly help.

Regards,
Karthik
# 2  
Old 01-12-2017
What happens if you do not SED the file? And email it.
Can you open it then?

By the way, xls files can be funny. I often work with csv files which are easier to manipulate and without fear of disrupting an embedded formatting commands.
These 2 Users Gave Thanks to joeyg For This Post:
# 3  
Old 01-12-2017
Thanks for the suggestion joeyg : ) I used CSV file instead of xls and it worked
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Converting xls file to xlsx on UNIX script / command line.

Hi All, Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
Discussion started by: arvindshukla81
2 Replies

2. UNIX for Advanced & Expert Users

How to read variable length file on UNIX generated by Mainframe?

Hi All, We have variable block file generated on Mainframe. We have to process the file on unix. So we FTPed the file on binary (as it has packed decimal fields). but i don't know how to read the file on unix. As you know variable block file will have a data like record length followed by... (2 Replies)
Discussion started by: SundarGampa
2 Replies

3. Shell Programming and Scripting

Expand cells in .xls file created in unix

Hi Guys, I am creating a comma separated file by quering the table and routing it to a file with an extension .xls. I am using the mailx command to send the .xls file to windows mail box. The file is coming as a excel attachment, but the cells are not expanded. Is there a way by which... (4 Replies)
Discussion started by: mac4rfree
4 Replies

4. UNIX for Advanced & Expert Users

Q on <user> of syslog message generated by logger command

Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry... (0 Replies)
Discussion started by: masaki
0 Replies

5. Shell Programming and Scripting

How to create xls file using unix script

Hi All, I want to create an xls file using shell script. I mean that I have written one script. It is having sql output. So I want to save that sql output into one xls file and I want to send that file as a attachment to my team MAIL_IDs. Can You any guy help me in this? Thanks in... (3 Replies)
Discussion started by: raghu.iv85
3 Replies

6. Shell Programming and Scripting

converting xls file to txt file and xls to csv

I need to convert an excel file into a text file and an excel file into a CSV file.. any code to do that is appreciated thanks (6 Replies)
Discussion started by: bandar007
6 Replies

7. UNIX for Dummies Questions & Answers

Unix script to convert .csv file to.xls format

I have a .csv file in Unix box i need a UNIX script to convert the.csv files to.xls format. Its very urgent please help me. (1 Reply)
Discussion started by: moon_friend
1 Replies

8. Programming

how to add CRLF support for CSV file generated in unix

Helo, my server side system is running on a redhat linux o.s. I have c program on the server which export list file into CSV format. now, I want that my program on server side is able to add support for CRLF(carriage return Line feed)into csv file format. so how do i write C program whcih... (3 Replies)
Discussion started by: amitpansuria
3 Replies

9. Shell Programming and Scripting

Issues in the Format in excel file generated from unix machine

Hi, I have generated a report that contains many columns and since I need ir in excel format.. I just renamed te file to excel as follows: cp vijay.txt vijay.xls I have just attached this spreadsheet in the mail and I am getting it to my mail id. But, in the output excel, the columns that... (10 Replies)
Discussion started by: Vijay06
10 Replies

10. Shell Programming and Scripting

linking unix generated text file to html page

i am trying to link the text files that i generated from my shell script to an html page, to that i can view them using a browser, like internet explorer. i want to open the text files in html page when i enter a command to view the text file from the shell command. please could anyone help... (1 Reply)
Discussion started by: alexd
1 Replies
Login or Register to Ask a Question