The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
complete file name displayed instead of extension wolverine999 Shell Programming and Scripting 7 05-20-2009 12:57 PM
How to edit particular cell of csv file using shell script deepak_p86 Shell Programming and Scripting 6 04-06-2009 07:11 AM
BASH complete-filename & menu-complete together Mithu UNIX for Dummies Questions & Answers 0 01-06-2009 03:00 PM
Ensure FTP is complete before using file GMMike UNIX for Dummies Questions & Answers 10 07-11-2007 05:14 AM
Unique cell vaules in a file rahulrathod Shell Programming and Scripting 3 01-17-2006 07:42 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-19-2009
rakesh_pagadala rakesh_pagadala is offline
Registered User
  
 

Join Date: May 2009
Location: hyderabad
Posts: 20
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 (permalink)  
Old 06-20-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,046
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 (permalink)  
Old 06-22-2009
rakesh_pagadala rakesh_pagadala is offline
Registered User
  
 

Join Date: May 2009
Location: hyderabad
Posts: 20
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 (permalink)  
Old 06-22-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,046
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 (permalink)  
Old 06-22-2009
rakesh_pagadala rakesh_pagadala is offline
Registered User
  
 

Join Date: May 2009
Location: hyderabad
Posts: 20
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 (permalink)  
Old 06-22-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,046
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 ...
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0