LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Redirect output in .xls or csv format (https://www.linuxquestions.org/questions/programming-9/redirect-output-in-xls-or-csv-format-777187/)

jeesun 12-21-2009 04:22 AM

Redirect output in .xls or csv format
 
Dear All

I have a shell script which is purging files and show the output in stdout. How can I redirect the output which shows in stdout in CSV or XLS format?

My script need to pass some input before showing output.

colucix 12-21-2009 04:34 AM

Hi. Can you provide an example of what you get on the standard output and what you wish? Redirecting the output to a CSV file can be performed by parsing the text and placing the commas in the proper positions. Creating a XLS is far more complicate, since this should involve (for example) scripting in OpenOffice. For this reason I would stick with the CSV solution, since you can easily import it into any spreadsheet program.

jeesun 12-22-2009 02:38 AM

1 Attachment(s)
Please check the script

colucix 12-22-2009 02:52 AM

Well, your script has no comments inside. A brief explanation (speech) of what you get and what is the desired output would be appreciated. Using code tags to preserve spacing would be even better.

jeesun 12-23-2009 11:06 PM

Currently the output of this script is

DateandTime What
---------------------- -----------------------------------------------------------------------
24_Dec_09_Thu_09:46:30 mon
menu.sh
ssh host
mon
date

But this output comes in standard output. But I need this output as it is in csv format.

AnanthaP 12-25-2009 05:56 PM

In the last line, you should be able to aud > output.csv or something.

What exactly did you try?

End


All times are GMT -5. The time now is 06:07 PM.