You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "rahul.soa" <ra...@googlemail.com> on 2011/06/01 13:48:03 UTC

Re: [Excel- Blank/Empty Cell]

Hi Hamza,

Thanks for your email.

It did not really work for me.

for (HSSFRow row = (HSSFRow) rows.next(); rows.hasNext(); row =
(HSSFRow) rows.next()) {
                Iterator cells = row.cellIterator();
                for (HSSFCell cell = (HSSFCell) cells.next(); cells.hasNext();
                        cell = (HSSFCell) cells.next()) {
}

I think [ cell = (HSSFCell) cells.next()) ] "cell" does not consider
blank/empty cell in the sheet so
cell.getStringCellValue().compareTo("") did not work for me.

Now my requirement has changed, so changed my program accordingly.

Rahul

On Tue, May 31, 2011 at 2:24 PM, Hamza Abdelkebir
<ha...@gmail.com> wrote:
> Hello,
> You could maybe try testing like this
>
> cell.getStringCellValue().compareTo("");
>
> Not sure this workds though,
>
> Regards,
> --
> Hamza
>
>
>
>
> On Tue, May 31, 2011 at 2:20 PM, rahul.soa <ra...@googlemail.com> wrote:
>
>> Hello Users, Devs,
>>
>> Sorry for asking a common question as I could not find the exact
>> answer, how to find a cell which is blank/empty (cell does not have
>> any value). Is there a way to know this? I have several rows of data
>> in xls file where in each row one or more cells are blank/empty. In my
>> program I would like to consider those blank/empty cells.
>>
>> Many Thanks,
>> Rahul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: [Excel- Blank/Empty Cell]

Posted by "rahul.soa" <ra...@googlemail.com>.
Many thanks Dave, I will have a look for MissingCellPolicy.

Best Regards,
rahul

On Wed, Jun 1, 2011 at 5:00 PM, Dave Fisher <da...@comcast.net> wrote:
> Hi -
>
> Look for MissingCellPolicy and set it according to your needs.
>
> Regards,
> Dave
>
> On Jun 1, 2011, at 4:48 AM, rahul.soa wrote:
>
>> Hi Hamza,
>>
>> Thanks for your email.
>>
>> It did not really work for me.
>>
>> for (HSSFRow row = (HSSFRow) rows.next(); rows.hasNext(); row =
>> (HSSFRow) rows.next()) {
>>                Iterator cells = row.cellIterator();
>>                for (HSSFCell cell = (HSSFCell) cells.next(); cells.hasNext();
>>                        cell = (HSSFCell) cells.next()) {
>> }
>>
>> I think [ cell = (HSSFCell) cells.next()) ] "cell" does not consider
>> blank/empty cell in the sheet so
>> cell.getStringCellValue().compareTo("") did not work for me.
>>
>> Now my requirement has changed, so changed my program accordingly.
>>
>> Rahul
>>
>> On Tue, May 31, 2011 at 2:24 PM, Hamza Abdelkebir
>> <ha...@gmail.com> wrote:
>>> Hello,
>>> You could maybe try testing like this
>>>
>>> cell.getStringCellValue().compareTo("");
>>>
>>> Not sure this workds though,
>>>
>>> Regards,
>>> --
>>> Hamza
>>>
>>>
>>>
>>>
>>> On Tue, May 31, 2011 at 2:20 PM, rahul.soa <ra...@googlemail.com> wrote:
>>>
>>>> Hello Users, Devs,
>>>>
>>>> Sorry for asking a common question as I could not find the exact
>>>> answer, how to find a cell which is blank/empty (cell does not have
>>>> any value). Is there a way to know this? I have several rows of data
>>>> in xls file where in each row one or more cells are blank/empty. In my
>>>> program I would like to consider those blank/empty cells.
>>>>
>>>> Many Thanks,
>>>> Rahul
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: [Excel- Blank/Empty Cell]

Posted by Dave Fisher <da...@comcast.net>.
Hi -

Look for MissingCellPolicy and set it according to your needs.

Regards,
Dave

On Jun 1, 2011, at 4:48 AM, rahul.soa wrote:

> Hi Hamza,
> 
> Thanks for your email.
> 
> It did not really work for me.
> 
> for (HSSFRow row = (HSSFRow) rows.next(); rows.hasNext(); row =
> (HSSFRow) rows.next()) {
>                Iterator cells = row.cellIterator();
>                for (HSSFCell cell = (HSSFCell) cells.next(); cells.hasNext();
>                        cell = (HSSFCell) cells.next()) {
> }
> 
> I think [ cell = (HSSFCell) cells.next()) ] "cell" does not consider
> blank/empty cell in the sheet so
> cell.getStringCellValue().compareTo("") did not work for me.
> 
> Now my requirement has changed, so changed my program accordingly.
> 
> Rahul
> 
> On Tue, May 31, 2011 at 2:24 PM, Hamza Abdelkebir
> <ha...@gmail.com> wrote:
>> Hello,
>> You could maybe try testing like this
>> 
>> cell.getStringCellValue().compareTo("");
>> 
>> Not sure this workds though,
>> 
>> Regards,
>> --
>> Hamza
>> 
>> 
>> 
>> 
>> On Tue, May 31, 2011 at 2:20 PM, rahul.soa <ra...@googlemail.com> wrote:
>> 
>>> Hello Users, Devs,
>>> 
>>> Sorry for asking a common question as I could not find the exact
>>> answer, how to find a cell which is blank/empty (cell does not have
>>> any value). Is there a way to know this? I have several rows of data
>>> in xls file where in each row one or more cells are blank/empty. In my
>>> program I would like to consider those blank/empty cells.
>>> 
>>> Many Thanks,
>>> Rahul
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: user-help@poi.apache.org
>>> 
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org