in reply to Excel from Perl
I suppose this (parsing the entire file, making changes, then writing it back) is the way to go, since modules like DBD::Excel seem to do it.
I had to face a similar problem some time ago. It was probably easier because I had to edit a set of fixed templates to generate weekly and monthly reports in Excel format for the management.
Lacking fancy formatting, CSV was not enough <SAD_BUT_TRUE>even though the information was just the same of course</SAD_BUT_TRUE>.
In the end I decided to parse the templates once, I wrote a set of long-but-easy functions, one for each template, then all I needed was just some additional code to write the actual data into the chosen template.
If your templates are not complex, you may decide to copy, not parse them, converting by hand into Perl code or whatever suits your needs.
The additional code I had for each template was a simple (yet longish) function taking a hash as a parameter with all the information I needed to "plug" in the template.
Obviously this is practical if you always have a fixed set of templates to edit, not sheets that differ every time.
-- TMTOWTDI
|
|---|