Bruce N wrote:
Hi Guys,
I have a question that is a bit unrelated but still related to Asterisk since
data is being passed from Asterisk. A script on my system writes data related
to Extension activity to a .xls file.
Using bash scripting, it is possible to create a file with extension .xls and tab separate each field to later on open it with Microsoft Excel.
However, I am wondering if I can have reports for all extensions be written to a single .xls file into different sheets using the respective extension as the sheet name. So, single .xls file but many sheets with each having data related to a single extension.
Is that possible at all? or does VB have to come into play? (something that I
don't like to do)
Other possible method might be to do a cron job to combine the files into one
big file and then make one single Excel file with one sheet but it would be
nasty and hard to deal with since each extension is not separate into different
sheets.
Thanks for the feedback,Bruce
The file you are currently creating is really just a text file with an
xls extension - it would appear this "trick" was used to make sure that
Excel is the program that opens it. When Excel opens the text file, it
figures out it really is not really an XLS file and processes it
correctly anyway.
What you want to do cannot be done with bash (as far as I know). You
will need a library that is capable of writing XLS format in one of the
languages you have available to you.
This cpan module might work (if you code in perl):
http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.25/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]