in reply to Delete entire row without using Win32::OLE

There are yet no modules, other than Win32::OLE, that allow you to directly delete a row in an Excel spreadsheet.

You can emulate this by reading each row (with Spreadsheet::ParseXLSX for instance) and then checking if that row is to be kept or deleted. If the row is to be kept, write it to a new Excel-file (with Excel::Writer::XLSX for instance) and once you have processed all sheets and rows in the original spreadsheet, your new spreadsheet should contain only the data you need.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics
  • Comment on Re: Delete entire row without using Win32::OLE

Replies are listed 'Best First'.
Re^2: Delete entire row without using Win32::OLE
by ravi45722 (Pilgrim) on Sep 02, 2015 at 06:04 UTC

    Thanks CountZero Now i am clear that no other module is available to delete entire row. I need other more information on these. I am working now with Spreadsheet::ParseXLSX to read values(Formatted) like this.

    $income = $cell->value();

    Is there any other one to read values(formatted). I also read about Spreadsheet::Read which cannot work with formatted values (working with unformatted)

      I also read about Spreadsheet::Read which cannot work with formatted values

      What ?

      my @row = Spreadsheet::Read::row ($book->[1], 3) Get full row of formatted values (like $sheet->{A3} .. $sheet->{G3})
      poj

        Sorry poj I missed that. I moved much forward through your suggestions. But i want to EDIT a .xlsx now for that i selected Excel::Writer::XLSX its creating a new file but not editing. Later i used Spreadsheet::ParseExcel::SaveParser which editing .xls files but not .XLSX. What I have to do to edit my .xlsx file(without loosing previous data).

        .