<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to convert the rtf text/symbols to plain text? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236462#M43327</link>
    <description>&lt;P&gt;Hello, everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have four variables start with {rtf1\.... symbols/text that I need to find some key words from there to generate a report. The contents include such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman\fprq2 Times New Roman;}{\f4\fswiss MS Shell Dlg;}{\f5\froman Times New Roman;}{\f6\fswiss\fprq2 System;}}&lt;/P&gt;
&lt;P&gt;{\colortbl\red0\green0\blue0;\red255\green0\blue0;}&lt;/P&gt;
&lt;P&gt;\deflang1033\pard\plain\f5\fs20&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 System;}{\f5\froman\fprq2 Times New Roman;}}&lt;/P&gt;
&lt;P&gt;{\colortbl\red0\green0\blue0;}&lt;/P&gt;
&lt;P&gt;\deflang1033\pard\plain\f3\fs20&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}}&lt;/P&gt;
&lt;P&gt;\viewkind4\uc1\pard\f0\fs20\par&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not know what are these symbols/text mean. I need to convert these text/symbols to plain text, so that I can search for the key words that I need. &amp;nbsp;Any suggestions/hints will be very appreciated! Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2015 17:35:32 GMT</pubDate>
    <dc:creator>Yurie</dc:creator>
    <dc:date>2015-11-25T17:35:32Z</dc:date>
    <item>
      <title>How to convert the rtf text/symbols to plain text?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236462#M43327</link>
      <description>&lt;P&gt;Hello, everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have four variables start with {rtf1\.... symbols/text that I need to find some key words from there to generate a report. The contents include such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman\fprq2 Times New Roman;}{\f4\fswiss MS Shell Dlg;}{\f5\froman Times New Roman;}{\f6\fswiss\fprq2 System;}}&lt;/P&gt;
&lt;P&gt;{\colortbl\red0\green0\blue0;\red255\green0\blue0;}&lt;/P&gt;
&lt;P&gt;\deflang1033\pard\plain\f5\fs20&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 System;}{\f5\froman\fprq2 Times New Roman;}}&lt;/P&gt;
&lt;P&gt;{\colortbl\red0\green0\blue0;}&lt;/P&gt;
&lt;P&gt;\deflang1033\pard\plain\f3\fs20&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}}&lt;/P&gt;
&lt;P&gt;\viewkind4\uc1\pard\f0\fs20\par&lt;/P&gt;
&lt;P&gt;}"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not know what are these symbols/text mean. I need to convert these text/symbols to plain text, so that I can search for the key words that I need. &amp;nbsp;Any suggestions/hints will be very appreciated! Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 17:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236462#M43327</guid>
      <dc:creator>Yurie</dc:creator>
      <dc:date>2015-11-25T17:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the rtf text/symbols to plain text?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236484#M43328</link>
      <description>&lt;P&gt;Looks like you've read in some Word RTF document. How did you get there in first place?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would try to first extract the text only with non-SAS tools and only then use SAS for further processing. How to do this depends on your environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could for example use a VB&amp;nbsp;script&amp;nbsp;for extracting the text or also Tika does a really great job.&amp;nbsp;&lt;A href="https://tika.apache.org/download.html&amp;nbsp;" target="_blank"&gt;https://tika.apache.org/download.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 19:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236484#M43328</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-11-25T19:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the rtf text/symbols to plain text?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236487#M43329</link>
      <description>&lt;P&gt;Hello, Patrick&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just use SAS with ODBC connecttion to get the data (it's Oracle database). My connection code showing below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname&lt;BR /&gt;exports&amp;nbsp;&lt;BR /&gt;Oracle&lt;BR /&gt;path = &amp;nbsp;XXX&lt;BR /&gt;dbprompt = no&lt;BR /&gt;uid=&amp;amp;username.&lt;BR /&gt;Password=&amp;amp;pswd.&lt;BR /&gt;schema = XXX&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to connect the data with excel, access and I got all the same text messages. I will check the link that you provided here soon. Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 19:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236487#M43329</guid>
      <dc:creator>Yurie</dc:creator>
      <dc:date>2015-11-25T19:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert the rtf text/symbols to plain text?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236491#M43330</link>
      <description>&lt;P&gt;Oh... I see. So that's stored in a CLOB in Oracle. That's gonna be tricky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never been in your situation so can't speak out of experience. Just throwing some thoughts:&lt;/P&gt;
&lt;P&gt;- Everything I've proposed in my last post assumed that you have direct access to the RTF document as a file; but that's not the case&lt;/P&gt;
&lt;P&gt;- You would need to read the CLOB into multiple rows in SAS as a SAS variable can only hold 32KB. It's possible to do but needs some extra coding.&lt;/P&gt;
&lt;P&gt;- There must be a reason that someone stores the RTF's in Oracle. If you're just after something like number of hits for a search term then may be there is Oracle Text available and you could run your queries in-database and then just get the result back. I've never used Oracle Text so not sure how and if this could be called out of a remote SAS process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would try first:&lt;/P&gt;
&lt;P&gt;Make things work directly in-database (using SQL developer; using Oracle Text). Only once things work try and call it out of a SAS session.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 20:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-the-rtf-text-symbols-to-plain-text/m-p/236491#M43330</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-11-25T20:14:45Z</dc:date>
    </item>
  </channel>
</rss>

