Sorting Data

376 views
Skip to first unread message

sokkerstud11

unread,
Apr 28, 2008, 1:17:42 PM4/28/08
to Spreadsheet::WriteExcel
Is it possible to sort data (either ascending or descending) using
WriteExcel? I found another package called SimpleExcel that has a
function called "sort_data" that does exactly what I would be looking
for, but unfortunately, it doesn't have most of the features that I
need (and use) in WriteExcel. Thank you very much for your time!

-Matt

jmcnamara

unread,
Apr 28, 2008, 6:35:54 PM4/28/08
to Spreadsheet::WriteExcel

On Apr 28, 6:17 pm, sokkerstud11 <NoSenseWorry...@gmail.com> wrote:
> Is it possible to sort data (either ascending or descending) using
> WriteExcel?

Hi Matt,

Sorting data isn't part of the Excel file format. It is performed
dynamically in Excel. As such you can't use Spreadsheet::WriteExcel to
sort your data.

The best approach is to sort your data in Perl before writing it to an
Excel file with WriteExcel.

> I found another package called SimpleExcel that has a
> function called "sort_data" that does exactly what I would be looking
> for

SimpleExcel uses Perl to do the sorting. Just in case you aren't
familiar with sorting in Perl here is some information:

http://perldoc.perl.org/functions/sort.html
http://www.perlmonks.org/?node_id=599204 (and the further links)
http://raleigh.pm.org/sorting.html

John.
--

sokkerstud11

unread,
Apr 28, 2008, 7:24:26 PM4/28/08
to Spreadsheet::WriteExcel
Hi John,

Thanks so much for the quick response. I really appreciate it!

I'll look into the links that you provided and see what I can do.

Have a great day!

-Matt
> http://www.perlmonks.org/?node_id=599204(and the further links)
> http://raleigh.pm.org/sorting.html
>
> John.
> --
Reply all
Reply to author
Forward
0 new messages