Data::Table::Excel

Convert between Data::Table objects and Excel (xls/xlsx) files
Download

Data::Table::Excel Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yingyao Zhou
  • Publisher web site:
  • http://search.cpan.org/~ezdb/

Data::Table::Excel Tags


Data::Table::Excel Description

Data::Table::Excel is a Perl module that provides utility methods to convert between an Excel file and Data::Table objects. It then enables you to take advantage of the Data::Table methods to further manipulate the data and/or export it into other formats such as CSV/TSV/HTML, etc.SYNOPSIS use Data::Table::Excel; # read in two CSV tables and generate an Excel .xls binary file with two spreadsheets my $t_category = Data::Table::fromFile("Category.csv"); my $t_product = Data::Table::fromFile("Product.csv"); # the workbook will contain two sheets, named Category and Product # parameters: output file name, an array of tables to write, and their corresponding names tables2xls("NorthWind.xls", , ); # read in NorthWind.xls file as two Data::Table objects my ($tableObjects, $tableNames)=xls2tables("NorthWind.xls"); for (my $i=0; $i, " ***\n"; print $tableObjects->->csv; } Outputs: *** Category *** CategoryID,CategoryName,Description 1,Beverages,"Soft drinks, coffees, teas, beers, and ales" 2,Condiments,"Sweet and savory sauces, relishes, spreads, and seasonings" 3,Confections,"Desserts, candies, and sweet breads" ... *** Product *** ProductID,ProductName,CategoryID,UnitPrice,UnitsInStock,Discontinued 1,Chai,1,18,39,FALSE 2,Chang,1,19,17,FALSE 3,Aniseed Syrup,2,10,13,FALSE ... # to deal with Excel 2007 format (.xlsx), use # since not table name is supplied, they will be named Sheet1 and Sheet2. # here we also provide custom colors for each sheet, color array is for tables2xlsx("NorthWind.xlsx", , undef, , ]); # read in NorthWind.xlsx file as two Data::Table objects my ($tableObjects, $tableNames)=xlsx2tables("NorthWind.xlsx");Product's homepage


Data::Table::Excel Related Software