LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to export reports generated in Linux to excel sheets. (https://www.linuxquestions.org/questions/programming-9/how-to-export-reports-generated-in-linux-to-excel-sheets-693043/)

sumitdevbharadwaj 12-26-2008 05:38 AM

How to export reports generated in Linux to excel sheets.
 
Hi All,

I use linux remotely through Putty. Now I wish to write script in which I am supposed to login into various systems, pickup some data and then generate reports daily and those reports to be exported to excel.

Main problem I m facing is how to export my report file to excel?
Can somebody please guide me how I can achieve this. Or you can provide me the links to various docs related to this.

Thanks a lot in advance.

Merry Christmas.

Regards
Sumit Dev Bharadwaj

unihiekka 12-26-2008 06:26 AM

I guess your reports are not in the excel format (xls) but rather (ASCII) text files generated from console commands?

Hmm, one way would be to create tab delimited files and then import them in excel so that you can then save them in the desired format. There is some software available for conversions to and from *.xls, but they depend on your system and the software installed on them. You might want to search the internet or give some more details about what your report files contain and how they should be exported/converted.

paulsm4 12-26-2008 10:12 AM

Hi -

Unihiekka is correct: ".csv" (comma- or tab-delimited files) are absolutely the way to go:

http://en.wikipedia.org/wiki/Comma-separated_values

You can easily read and write .csv files from a script.

'Hope that helps .. PSM

Guttorm 12-29-2008 10:58 AM

Hi

If you for some reason cannot use CSV files, or you want coloring or cell formating, you can write Excel files with Perl:

http://search.cpan.org/dist/Spreadsheet-WriteExcel/

You need to install the Perl module first. On Debian/Ubuntu:

sudo apt-get install libspreadsheet-writeexcel-perl

It also installs many nice examples in /usr/share/doc/libspreadsheet-writeexcel-perl/

sumitdevbharadwaj 12-29-2008 11:18 PM

Hi All,

Thanks a lot. It is surely helping. I'll get back in case I feel further prob.

Bbye and have a Fantastic Year ahead.


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