Hi,
Hi,
Please download and try this fix: Aspose.Cells for Java v7.2.0.4
We have supported regex in the string parameter to be searched, code like:
Java
Cells.findString(“abc*def”, null);
Hi, We have purchased the License copy of Aspose.cells. At that time we got 7.1.2 version of aspose-cells jar. So how do we go about this latest version now? Please guide. And also the findString method which takes cellArea as in parameter doesn't seem to have given this feature. Please provide it in that method too and all other findString methods. That would be great. Thanks.
Regards,
Rohan R. Naik
Hi,
Ok. Thanks.
Regards,
Rohan Naik
Hi,
Please download and try the latest fix:
Aspose.Cells
for Java v7.2.0.5
We have supported find objects in range by new API: FindOptions.setRange(CellArea).
Please see the following code.
Java
FindOptions opt = new FindOptions();
opt.setRange(CellArea.createCellArea(“A1”, “A9”));
cells.find(findObj, prevCell, opt);
Hi, I am sorry to say but the regex search feature doesn't seem to work with this. Please just have a look and update if i am wrong. Thanks.
Regards,
Rohan Naik
Hi,
Hi. Please find the below code where i am using the find method to search string using regex. Also find the attached sample file. Thanks.
String filepathA = "C://FileA.xls";
String test = "*Close of*";
try{
LoadOptions loadOptions1 = new LoadOptions(FileFormatType.EXCEL_97_TO_2003);
Workbook workbook1 = new Workbook(filepathA,loadOptions1);
FindOptions opt = new FindOptions();
opt.setRange(CellArea.createCellArea("A8", "F8"));
Cell c5 = workbook1.getWorksheets().get(0).getCells().find(test, null, opt);
Hi,
String filepathA = “C://FileA.xls”;
String test = “Close of”;
try{
LoadOptions loadOptions1 = new LoadOptions(FileFormatType.EXCEL_97_TO_2003);
Workbook workbook1 = new Workbook(filepathA,loadOptions1);
FindOptions opt = new FindOptions();
opt.setRange(CellArea.createCellArea(“A8”, “F8”));
Cell c5 = workbook1.getWorksheets().get(0).getCells().findString(test, null, opt);
I have tested it with your file and it works fine.
Thank you.
Hi,
For searching string value in a specified range, especially for regex, please use corresponding Cells.findString(…) methods that with CellArea parameter instead of Cells.find() method. Currently Cells.find() method does not support regex and Cells.findString(String inputString, Cell previousCell,FindOptions findOptions) does not support specified range in FindOptions.
Currently Cells.find() method does not support regex and Cells.findString(String inputString, Cell previousCell,FindOptions findOptions) does not support specified range in FindOptions
Hi, In version v7.2.0.5 of Aspose.cells for java, FindOptions does provide FindOptions.createRange() method to specify the range. So i can use this right?
Thanks & Regards,
Rohan Naik
Hi,
We think you are talking about FindOptions.setRange() method. Yes, you can use it to specify a search range for Cells.find(Object, Cell, FindOptions) method. However, the specified range does not take effect for method findString(String, Cell, FindOptions) currently (So you cannot search a regex in a specified range with the current fix). We will try to make this method support for the specified range soon in later fixes.
Thank you.
Hi,
Yes indeed. Even if you specify range in FindOptions, it searches outside that range too. in short the whole sheet is searched even with provided range. Do let me know here when that findString method works fine. Thanks!
Regards,
Rohan Naik
Hi,
Thanks for your posting.
I have logged your comment in our database against the issue id: CELLSJAVA-40178
We will let you know once we will have some update for you.
Hi,
Hi, I tested it with the latest jar. But it doesn't seem to work. Please find the below code and attached file.
public static void main(String[] args) {
String filepathA = "C://FileA.xls";
String test7 = "*Close of*";
try{
LoadOptions loadOptions1 = new LoadOptions(FileFormatType.EXCEL_97_TO_2003);
Workbook workbook1 = new Workbook(filepathA,loadOptions1);
FindOptions opt = new FindOptions();
opt.setRange(CellArea.createCellArea("A8", "F8"));
Cell c = workbook1.getWorksheets().get(0).getCells().findString(test7,null, opt);
}catch(Exception e){
e.printStackTrace();
}
}
Hi,
Hi,
Please use the following code for searching regex in range:
Java
opt.setRange(CellArea.createCellArea(“A8”, “F8”));
opt.setLookAtType(LookAtType.ENTIRE_CONTENT);
Cell c = workbook1.getWorksheets().get(0).getCells().find(test7, null, opt);
…
The issues you have found earlier (filed as CELLSJAVA-40178) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.