I want to parse the Text entered in the Body field of a notes document in a particular fashion. For Eg.
Peace for people who live in this world
llkpo098877333
Now i want to parse the following text on the logic that All dashes to be removed . First line to be taken as subject and the text which contains both number and text without space to be remove.
CAN ANY ONE SUGGEST THE POSSIBILITYOF THIS … IIF YES THEN PLEASE DO GIVE A SUGGESTION.
If a third party product is a possibility, our Midas Rich Text LSX will do this quite easily. We have a sample db available that I showed at the UK Admin-Developer conference a few weeks ago that does a very similar set of steps.
If budget or policy doesn’t allow for a third party product, you could start with the NotesRichTextNavigator and get each text run and search the text run for the appropriate text, removing it if necessary or saving it into the Subject field. I have had some trouble getting this to work well with portions of text such as you describe, but I have less incentive to get it to work than you may.
I don’t see why this couldn’t be done without any specialized APIs. NotesRichTextItem.GetFormattedText (specifying a nice long line length), and string functions to parse out the result, should be able to do it.
Because you can’t accurately tell the beginning of a line, and part of the goal is to determine the “first line” or any line with only number and spaces.
Yes, if the line exceeds 32,000 characters, or whatever you specify to GetFormattedText as the line max length, the program will mistake it for multiple lines. A big “so what” to that. While I agree with your often expressed opinion that we could use more rich text programmability, in this case I think the built-in classes are adequate, as this situation is very unlikely to occur in the application data.
You are probably correct. I may get a skewed impression because people tend to come to me when they have had a problem, so I sometimes think the problem is more prevelant than it is. In this case, most people either a) want some formatting left intact (usually just text attributes or paragraph attributes) or b) have too much data and run into the item limits. Those may not be usual problems, but I wouldn’t have any way of knowing.