Functions of esProc/R/Python/Perl in Structured Data Process by Comparison :Chapter 18.Writing to Excel


It can be written out with one statement, and you can specify the field name, sheet name to be exported.




  use strict;

  use Win32;


  use Win32::OLE qw(in with); 

  use Win32::OLE::Const ‘Microsoft Excel’; 

  $Win32::OLE::Warn = 3;                             


  my $Excel = Win32::OLE->GetActiveObject(‘Excel.Application’) 

      || Win32::OLE->new(‘Excel.Application’, ‘Quit’); 

  use Encode; 


  my $outexcel1=”d:/out.xls”;

  my $Book = $Excel->Workbooks->Open(“$outexcel1”) or die “Could not open the   $outexcel1 !!!\n”; 

  my $Sheet = $Book->Worksheets(1); 

  my @carts=([173744,”aaa”,14],



  my $row=1;

  for each(@carts) 


    $Sheet->Cells($row,1)->{‘Value’}=$_->[0];  # Only write out cell by cell







  from pyExcelerator import *

    w = Workbook()     #Create a workbook

  ws = w.add_sheet(‘sheet1’)     # Create a worksheet


    for i in range(0,len(a)):


         ws.write(i,1)=a[i][1]‘d:/out.xls’)     #Save it


After having looked for a long time, by searching from a number of official Webs and Help documents, no any approach could be available for exporting the .xls file, but only one for .txt and .csv files. esproc_r_perl_python_18


About datathinker

a technical consultant on Database performance optimization, Database storage expansion, Off-database computation. personal blog at: datakeywrod, website: raqsoft
This entry was posted in esProc/R/Python/Perl, Structured Data Process and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s