on 2017 Oct 16 5:12 AM
Is there any function in sybase to convert rtf text to plain text. We use SA17
Request clarification before answering.
No, SQL Anywhere does not have any functions to convert documents from one format to another. You will need to use some external application to do this type of operation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Depending on the expected content of the rich text, there are several examples posted on the internet that use regular expressions that can do this for most rich text.
There are also several examples using Java and C# (.NET CLR). The C# version uses a MS RichTextBox control text property which contains the text of the control excluding the rich text format codes. You could then use the external environment feature to access the Java or .NET CLR code like a procedure.
FYI here is one version of the RTF specifications... are you sure you want regular expressions to deal with that?
As Breck clarified with the RTF spec and I hinted in my initial response, this will be difficult to achieve with regular expressions except in some specific cases. Most of the threads that I read on line on this topic suggested that a parser would be the only real solution to this. I proposed taking advantage of java or .NET as they have existing objects that can do that heavy lifting and can be used as an external environment in SQL Anywhere.
Hm, I see a good option: textutil (BSD, MacOS): http://osxdaily.com/2014/02/20/batch-convert-docx-to-txt-mac/
It is not to find a console library that converts from RTF to TXT (to HTML is possible, but not to TXT).
I'd better close this question as "use 3rd-party tools".
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.