How to extract plain text from RTF string using Firebird SQL

亡梦爱人 提交于 2019-12-11 07:13:15

问题


I have RTF strings stored in a blob field in my database table. Example 1: The following blob RTF string stores plain text - 'Gluten, oeufs, lait, fruits à coque':

{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil Tahoma;}}{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\lang4108\f0\fs16  Gluten, oeufs, lait, fruits \'e0 coque\f1\par}

Example 2:

{\rtf1\ansi\ansicpg1252\deff0\deflang4108{\fonttbl{\ \fnil\fcharset0 Tahoma;}{\f1\fnil Tahoma;}}{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\f0\fs16 Farine de froment, Gruy\'e8re AOP 28%, tomates, mayonnaise (huile de tournesol, oeufs, eau, vinaigre, moutarde, sucre, sel), cornichons (cornichons, vinaigre, sel, sucre, extrait d'\'e9pices, \'e9pices, antioxydant E224), eau, sel, levure, gluten, farine de malt d'orge, \'e9paississant E412, dextrose, \'e9mulsifiant E472e, agent de traitement de la farine E300\f1\par}

Stores : 'Farine de froment, Gruyère AOP 28%, tomates, mayonnaise (huile de tournesol, oeufs, eau, vinaigre, moutarde, sucre, sel), cornichons (cornichons, vinaigre, sel, sucre, extrait d'épices, épices, antioxydant E224), eau, sel, levure, gluten, farine de malt d'orge, épaississant E412, dextrose, émulsifiant E472e, agent de traitement de la farine E300'.

How to extract the plain texts from the RTF string?

来源:https://stackoverflow.com/questions/29841579/how-to-extract-plain-text-from-rtf-string-using-firebird-sql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!