![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to edit particular cell of csv file using shell script | deepak_p86 | Shell Programming and Scripting | 6 | 04-06-2009 08:11 AM |
| Concatenating arrays cell values in shell scripting | mathur | UNIX for Dummies Questions & Answers | 2 | 10-31-2008 08:40 AM |
| Shell Script Output | sharpi03 | Shell Programming and Scripting | 4 | 09-20-2008 12:16 AM |
| Shell script getting input from output | aspect_p | Shell Programming and Scripting | 1 | 03-11-2008 07:37 AM |
| redirecting SQL output from within a shell script | soliberus | Shell Programming and Scripting | 2 | 11-23-2007 08:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
get output in each cell from shell script
Hi,
I have a code which gives me different values all in a same line. what do i change to make the output have each value in each cell. code: echo $user $firstname $lastname $address done | tee userinfo.xls i want the $user value to be in first cell of excel, $firstname in the second cell etc. |
|
||||
|
Hello,
You are trying to write an xls file like a flat file. When you open up excel for this file, it picks the data and puts all in 1 cell. 1 (bad) way out is to save the file as csv. Excel would read it automatically as u want, using [space] or comma as delimiter. It is advised that u use some program to write an excel sheet, using some language like java etc. I ve done this using java. If it can be done in any other way, others maybe able to help you. I would like to know that too .Regards, HKansal Last edited by hkansal; 04-23-2009 at 08:07 PM.. |
|
||||
|
Yeah, you need to write out the file as a comma-delimited file and name it with a '.csv' extension: Code:
echo $user, $firstname, $lastname, $address > name.csv This will put the columns into each cell in csv/xls. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|