Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Counting number of substrings within a string | ||||||
---|---|---|---|---|---|---|---|
Product: | Calc | Reporter: | discoleo <discoleo> | ||||
Component: | code | Assignee: | AOO issues mailing list <issues> | ||||
Status: | CONFIRMED --- | QA Contact: | |||||
Severity: | Trivial | ||||||
Priority: | P3 | CC: | issues | ||||
Version: | OOo 2.2 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Issue Type: | ENHANCEMENT | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
discoleo
2007-04-06 17:56:18 UTC
Created attachment 44257 [details]
Proposed C++ implementation
1. I just wanted to add a real life example. My primary work involves auditing the whole medical activity taking place in a big county. One frequent task is to count the number of different diagnoses for individual patients. The string looks like this: "B18.1; G20; I20.9; I12.9". These tokens represent individual ICD10-coded diagnoses. So, I would like to count how many diagnoses are there (i.e. FindCount(";",'the_string') + 1). 2. I found the code for *REGEXP* searches inside the ScInterpreter::ScSearch() function. Unfortunately, I do NOT understand much of it and I fear that there is NO good documentation on it. I will try to implement a ScSearchCount() function later, just by cloning the ScSearch() function. Hi Niklas, please have a look at this patch. Frank We generally don't want to add many new internal functions. Additional functions can preferably be added as add-in components. Also, issue type "patch" should be limited to complete patches, ready to apply. If A1 contains "ab cd ab de" and B1 contains "ab", we can use =(LEN(A1)-LEN(SUBSTITUTE(A1;A2;"")))/LEN(A2) which I realize is messy but it gets the job done. Oops, I meant: If A1 contains "ab cd ab de" and A2 contains "ab" … Reset assigne to the default "issues@openoffice.apache.org". |