in reply to how to consolidate xls/csv/text into one report?

The DBD::AnyData module handles CSV, XML, HTMLtable, Fixed-Width, Weblog, Ini-file, and many other formats. It's also extensible so if you have a format that isn't providied, you can create a simple parser for it. It was designed for exactly the task you are describing.
  • Comment on Re: how to consolidate xls/csv/text into one report?

Replies are listed 'Best First'.
Re^2: how to consolidate xls/csv/text into one report?
by tphyahoo (Vicar) on Apr 29, 2005 at 08:19 UTC
    Thanks for the tip. Hitting the search engines for

    dbd anydata excel

    I came up with modules for reading Excel files which mentions (among others):

    • Spreadsheet::TieExcel
    • DBD::Anydata - CSV
    • DBD::Excel - DBD wrapper for Spreadsheet::WriteExcel and Spreadsheet::ParseExcel
    UPDATE: TieExcel seemed initially promising, only, quoting from the documentation:

    "Quirks You can't, for now, write anywhere else than the active workbook, and Excel must be open for all this to work. In the best M$ tradition, this and other quite obvious and necessary features will be available in some future version."

    But despite this I may try it out anyway, I like this easy excel/perl hash equivelancy, I think this is what would make it easiest for me to figure out how to clean up my spreasheets.

      If you are going to dump into a database anyway, it would seem simpler to to treat your input sources as databases also. I suggested DBD::AnyData becuase it supports multiple formats. It can import from any DBI accessible data source, including CSV, many different text formats, and Excel (with DBD::Excel). This means that you can use DBI to read all of your data regardless of its format and to write your data. In a situation such as you are describing that makes a lot more sense then using one module to read Excel, another to read CSV, a third to read text format foo and a fourth to read text format bar and a fifth to write the data. Actually DBD::AnyData makes use of those other modules (e.g. it would be using the excellent Spreadsheet::ParseExcel to actually read the Excel sheet or the excellent XML::Twig to read XML files), but provides you with a single interface to those modules and to the other parsing modules so that your script only needs one interface rather than one interface per format.