Hi ,
As I said I am having these values in multimap
{Deepak=[[[[F1, F4]]]], Ajinkya=[[[[F2, F5]]]]}
And want to read a existing excel file and replace the value available in F1
and F4 with Deepak.
So I need to read the excel too.
I tried some ways In java , but got stucked.
-----Original Message-----
From: Javen O'Neal [mailto:[email protected]]
Sent: Monday, November 14, 2016 12:00 PM
To: POI Users List <[email protected]>
Subject: Re: XSSF for XLS usinh multimap
Is this a question about how to iterate over a multimap or how to set a cell
value in POI?
Read the javadocs for the multimap implementation you are using.
For example, org.apache.commons.collections4.MultiValuedMap is here:
https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MultiValuedMap.html
Read the POI HSSF and XSSF quick guide to learn how to set a cell value as a
string.
https://poi.apache.org/spreadsheet/quick-guide.html#Creating+Cells
The pseudo-code/python answer:
# Getting a Cell object at a CellAddress addr on a Sheet sheet def
getCell(sheet, addr):
r = addr.getRow()
c = addr.getColumn()
# create row if it does not exist
row = sheet.getRow(r) or sheet.createRow(r)
cell = row.getCell(c) or row.createCell(c)
return cell
# Iterating over a multi-map
for name, addresses in amultimap.items():
for addr in addresses:
getCell(sheet, addr).setCellValue(name)
On 11/13/16 10:34, Tripathi, Shiv Deepak wrote:
> Hi All,
>
>
> I have a multimap:
>
> {Deepak=[[[[F1, F4]]]], Ajinkya=[[[[F2, F5]]]]}
>
> In this F1,F4 are nothing but cell Adress.
>
>
> I want to write These values in given cell number like:
>
> F1 and F4 should have Deepak as value.
>
> Can you please let me know how can I write it.
>
> I am using XSSF.
>
> Thanks in advance.
>
>
> Regards,
> Deepak
>
> ________________________________
> The information contained in this message may be confidential and legally
> protected under applicable law. The message is intended solely for the
> addressee(s). If you are not the intended recipient, you are hereby notified
> that any use, forwarding, dissemination, or reproduction of this message is
> strictly prohibited and may be unlawful. If you are not the intended
> recipient, please contact the sender by return e-mail and destroy all copies
> of the original message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] For additional
> commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional
commands, e-mail: [email protected]