I'm not absolutely clear what it is you want. There is a "Text to Columns" command in Excel, which may be what you are talking about. Anything that is available from the face of the spreadsheet is available from Win32::OLE. The classic advice is to record an Excel macro and translate that to Perl, but be warned that recorded macros are usually very bad VBA, and transliterating that without understanding it will lead to bad Perl. Is the following what you want?
use strict; use warnings; use Win32::OLE; my $xl = Win32::OLE->new('Excel.Application'); $xl->{Visible} = 1; my $wb = $xl->Workbooks->Add; for my $nSht (2..$wb->Sheets->{Count}) { $wb->Sheets(2)->Delete; } my $sht = $wb->Sheets(1); $sht->Cells(1, 1)->{Value}="a b"; $sht->Cells(2, 1)->{Value}="a c"; $sht->Cells(3, 1)->{Value}="ab c"; $sht->Range("A1:A3")->TextToColumns({ Destination => $sht->Range("A1"), Space => 1, });
Regards,
John Davies
In reply to Re: Excel > Data > Text to Columns (Win32::OLE)
by davies
in thread Excel > Data > Text to Columns (Win32::OLE)
by Bascule
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |