File need to send to xls as one complete cell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File need to send to xls as one complete cell
# 1  
Old 06-19-2009
File need to send to xls as one complete cell

Hi every one,
I have a file of ten lines in unix i want to send the file to my mail as .xls and the clause over here is it should send in only one cell ..

I am aware of
uuencode rest rest.xls | mail -s "testing" mailid

But this would send me data into seperate cells
# 2  
Old 06-20-2009
Hi.

Is your file a CSV file?

If so I tried this (and it worked with OpenOffice - don't know about MS Office)

Code:
cat rest | sed -e "s/.*/'&'/" | uuencode rest.xls | mailx ....

# 3  
Old 06-22-2009
Hi Scott,
I tried the given query but it didnot work while importing data to excel, Its still shows each line in different cells ...
# 4  
Old 06-22-2009
Hi Rakesh.

Perhaps if you'd give more details about the format of the file? i.e. is it a real XLS file (prabably not if you say it only has 10 lines), or a (CSV-style) text file.

If the data isn't sensitive, perhaps you could post it, if it's only 10 lines, otherwise give us the gist of how it looks (including funny control-looking stuff).

Thanks
# 5  
Old 06-22-2009
Hi Scott,
Thanks for you time . I can give a example as i cant paste my real data .. I see that in below o/p tables were not printed I need the whole data in one cell instead of 7 different cells

Input data in a file
Today, is, Monday
Today, is, Tuesday
Today, is, Wednesday
Today, is, Thursday
Today, is, Friday
Today, is, Saturday
Today ,is, Sunday

Output should come in the below format in xls



Today is Monday
Today is Tuesday
Today is Wednesday
Today is Thursday
Today is Friday
Today is Saturday
Today is Sunday



























# 6  
Old 06-22-2009
Hi Rakesh.

Ah, OK, then the entire lot should be quoted:

Code:
sed -e "1s/.*/\"&/;\$s/.*/&\"/" rest | uuencode rest.xls | mailx ...

(if you want the comma's removed too...)

Code:
sed -e "1s/.*/\"&/;\$s/.*/&\"/;s/,//g" rest | uuencode rest.xls | mailx ...

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Merge Text with space into once cell and send email out

Please help!! This code works perfect but the only problem I am having is that is treats eg SQL Developer as separate cell/column which makes the formatting bad. I want to put SQL Developer in one cell. I attached a sample of how the output looks like. report.txt USERNAME OSUSER ... (5 Replies)
Discussion started by: lpoolfc
5 Replies

2. Shell Programming and Scripting

Merging Multiple XLS into Different tabs in xls/ xlsx

HI, I have multiple files per dept in folder for eg : In a folder File1_Dept100.xls File2_Dept100.xls File3_Dept100.xls File1_Dept200.xls File2_Dept200.xls File3_Dept200.xls Output should be : Dept100.xls which has File1, File2, File3 in different tabs Dept200.xls which has... (1 Reply)
Discussion started by: venkyzrocks
1 Replies

3. Shell Programming and Scripting

Parse excel file with html on each cell

<DIV><P>Pré-condição aceder ao ecrã Home do MRS.</P></DIV><DIV><P>OK.</P></DIV><DIV><P>Seleccionar Pesquisa de Recepção Directa.</P></DIV><DIV><P>Confirmar que abriu ecrã de Recepção Directa.</P></DIV><DIV> (6 Replies)
Discussion started by: oliveiraum
6 Replies

4. Shell Programming and Scripting

Extract last cell of csv file

How do I extract the last cell in a column of a csv file using linux shell scripting? Or alternatively, how do I get the number of cells of a csv file? (2 Replies)
Discussion started by: locoroco
2 Replies

5. UNIX for Advanced & Expert Users

How to add two values in the same cell of CSV file

I need help to create a csv file with Unix command. In csv file, i need to put two values in the same cell. Rite now, whts happening is, if i put 2 values in the same cell, its comming as " asd, zxc" but i want it in different line but in same cell. asd zxc Please reply me ASAP. (1 Reply)
Discussion started by: Prashant Jain
1 Replies

6. Shell Programming and Scripting

how to extract the data from database (oracle) and send the output as an .xls file?

Hi, How to extract the data from Oracle database and sent the output data to mails using mailx command with .xls attachement? Here i know how to connect the database using unix shell script and how to use the mailx command in UNIX script But i don't know how to use the .xls format file (i... (1 Reply)
Discussion started by: psiva_arul
1 Replies

7. UNIX for Advanced & Expert Users

Converting .csv file into .xls file and send it to inbox

Hi All, I wrote a script to extract data from Oracle DB and place it in a text file , and I have coverted .txt file into comma seperated .csv file and I sent it to my mail box . I can get .xls file in my inbox.I am getting all data in same column and in different rows , without column... (1 Reply)
Discussion started by: krthkmuthu
1 Replies

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

9. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

10. Shell Programming and Scripting

Unique cell vaules in a file

I have a file in which I have records as follows -------------------------------------------------------------------------- 2-sister-birmbb-s0005.ftip002590790.vpn-nte.bt.net BRI0 0 0 0 aber-con-dyce-s0006.ftip002732992.vpn-nte.bt.net ATM0 0 0 0... (3 Replies)
Discussion started by: rahulrathod
3 Replies
Login or Register to Ask a Question