Note that there are some explanatory texts on larger screens.

plurals
  1. PORich text format (with formatting tags) in Excel to unformatted text
    primarykey
    data
    text
    <p>I have approx. 12000 cells in excel containing RTF (including formatting tags). I need to parse them to get to the unformatted text.</p> <p>This is the example of one of the cells with text:</p> <pre><code>{\rtf1\ansi\deflang1060\ftnbj\uc1 {\fonttbl{\f0 \froman \fcharset0 Times New Roman;}{\f1 \fswiss \fcharset238 Arial;}} {\colortbl ;\red255\green255\blue255 ;\red0\green0\blue0 ;} {\stylesheet{\fs24\cf2\cb1 Normal;}{\cs1\cf2\cb1 Default Paragraph Font;}} \paperw11908\paperh16833\margl1800\margr1800\margt1440\margb1440\headery720\footery720 \deftab720\formshade\aendnotes\aftnnrlc\pgbrdrhead\pgbrdrfoot \sectd\pgwsxn11908\pghsxn16833\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440 \headery720\footery720\sbkpage\pgncont\pgndec \plain\plain\f1\fs24\pard TPR 0160 000\par IPR 0160 000\par OB-R-02-28\par} </code></pre> <p>And all I really need is this:</p> <pre><code>TPR 0160 000 IPR 0160 000 OB-R-02-28 </code></pre> <p>The problem with simple looping over the cells and removing unnecessary formatting is, that not everything in those 12000 cells is as straightforward as this is. So I would need to manually inspect many different versions and write several variations; and still at the end there would be a lot of manual work to do.</p> <p>But if I copy the contents of one cell to empty text document and save it as RTF, then open it with MS Word, it instantly parses the text and I get exactly what I want. Unfortunately it's extremely inconvenient to do so for a 12000 cells.</p> <p>So I was thinking about VBA macro, to move cell contents to Word, force parsing and then copy the result back to the originating cell. Unfortunately I'm not really sure how to do it.</p> <p>Does anybody has any idea? Or a different approach? I will be really grateful for a solution or a push in the right direction.</p> <p>TNX!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload