Check if the worksheet column is empty/blank using Aspose.Cells for Java

Hi, I want to check if the column is empty/blank. Is there any method to check this?

Thanks,

Rohan


This message was posted using Page2Forum from community/public/documentation

Hi,

There is no quick way. You will have to iterate the column cells and check if they are blanks or with contents.

Hi,

That would be time consuming! Just like aspose has Cells.iterator it also has Columns.iterator. But if i get an iterator for column it does not fetch any records. i.e. if i do iterator.hasNext it returns false even if there is data in CSV file. The Cell.iterator works fine. Whats might be the problem?

Thanks,

Rohan

Hi,

You can create a range object, then you can use iterator of range object to iterate the cells.

For example, you want to traverse the cells in column number 6, so you can define a range something like this

(0,5, 12300, 5), then using the iterator, you can traverse all the cells from F1 till F12301.

Hi,

The iterator returned by ColumnCollection is for accessing every custom Column object, not cell objects in one Column. To access cell objects in specified column, you have to iterate cells from Cells.iterator() and check whether one Cell’s column index is equal to specified column. If it can fit your requirement, we may also add one new method such as Cells.isBlankColumn(int columnIndex) for you which will check whether given column does not contain any data.

Thank you.

Hi,

That will help! Given a Column Index if i am able to find if the column is blank using this Cells.isBlankColumn method then that would be great.

Thanks,

Rohan

Hi,

Thanks for your feedback.

We have added a New Feature Request in our database.

Once, it is available or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40122

Hi,

We have fixed this issue. Please download: Aspose.Cells for Java (Latest Version)

Now we have added one new method:

Cells.isBlankColumn(int columnIndex)

The issues you have found earlier (filed as CELLSJAVA-40122) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.