You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Fr...@isc-ejpd.admin.ch on 2004/12/03 11:34:56 UTC
HWPF search&replace
Hi,
I'm looking for a way to find and replace strings in a word file. Actualy I
was not able to find the right method to do that in the api. Could anyone
help me?
Basicly my application take a word file in input (template) and replace
defined keys (like "${AMOUNT}") with values. To do that, I iterate through
the paragraphs and look for my pattern. Then I need some methods like
deleteString(start, begin) and insertAt(offset, text).
Or is that another way to do the same thing?
Thank you,
Frederic
__________________________________________
Informatik Service Center EJPD
Softwarelösungen / Ausländeranwendungen
Webergutstrasse 5, CH-3003 Bern-Zollikofen
Tel.: +41 (0)31 323 34 76 Mob.:+41 (0)78 734 11 66
mailto:frederic.dreier@isc-ejpd.admin.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: HSSF: inserting a new column in existing sheet
Posted by Marko Asplund <ma...@kronodoc.com>.
On 06 Dec, 2004, at 19:44, Danny Mui wrote:
> maybe copy the shiftrows logic as a shiftcolumns? shiftrows renumbers
> formulas and such based on row number, so doing the same to columns
> shouldn't be that much of a bother.
>
> grab the source and give it a shot!
>
> or post a bugzilla enhancement request and vote for it.
created an enhancements request for this:
http://issues.apache.org/bugzilla/show_bug.cgi?id=32562
best regards,
--
aspa
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: HSSF: inserting a new column in existing sheet
Posted by Danny Mui <da...@muibros.com>.
maybe copy the shiftrows logic as a shiftcolumns? shiftrows renumbers
formulas and such based on row number, so doing the same to columns
shouldn't be that much of a bother.
grab the source and give it a shot!
or post a bugzilla enhancement request and vote for it.
Marko Asplund wrote:
>
> i'm trying to figure out how to insert a new column in the middle of
> existing columns with HSSF usermodel API for spreadsheets that have been
> created with MS Excel. HSSFRow.createCell() seems to insert a cell
> replacing the existing cell, so it can't be used in a similar fashion as
> you would with rows (HSSFSheet.shiftRows()). i was thinking about just
> creating a new cell in the end of each row and then shifting (copying)
> the values of existing cells to the left. on second thought this does
> not seem to work when there're formula cells in the existing sheet
> (HSSFCell.setCellType() not supported for formulas according to
> documentation). also, does HSSF support all types of cells that can be
> created by MS Excel?
>
> how would other people solve this insertion problem?
>
> best regards,
> --
> aspa
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
HSSF: inserting a new column in existing sheet
Posted by Marko Asplund <ma...@kronodoc.com>.
i'm trying to figure out how to insert a new column in the middle of
existing columns with HSSF usermodel API for spreadsheets that have
been created with MS Excel. HSSFRow.createCell() seems to insert a cell
replacing the existing cell, so it can't be used in a similar fashion
as you would with rows (HSSFSheet.shiftRows()). i was thinking about
just creating a new cell in the end of each row and then shifting
(copying) the values of existing cells to the left. on second thought
this does not seem to work when there're formula cells in the existing
sheet (HSSFCell.setCellType() not supported for formulas according to
documentation). also, does HSSF support all types of cells that can be
created by MS Excel?
how would other people solve this insertion problem?
best regards,
--
aspa
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org