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}="Filesystem 1024-blocks Used Available Capacity Mounted on"; $sht->Cells(2, 1)->{Value}="/abc/defghi/dskvg00-root 1015704 546516 416760 57% /"; $sht->Cells(3, 1)->{Value}="/abc/defghi/dskvg00-var 2539312 1054620 1353636 44% /var"; $sht->Cells(4, 1)->{Value}="/abc/defghi/dskvg00-tmp 1552232 41392 1432208 3% /tmp"; $sht->Cells(5, 1)->{Value}="/abc/defghi/dskvg00-home 126931 5693 114685 5% /home"; $sht->Cells(6, 1)->{Value}="/abc/defghi/dskvg00-usr 2539312 1240960 1167280 52% /usr"; $sht->Cells(7, 1)->{Value}="/abc/defghi/dskvg00-usrlocal 126931 7146 113232 6% /usr/local"; $sht->Range("A1:A" . $sht->UsedRange->Rows->{Count})->TextToColumns({ Destination => $sht->Range("A1"), Space => 1, ConsecutiveDelimiter => 1, }); $sht->UsedRange->Columns->AutoFit;