Crystal Reports Developer who to write a formula that will extract a portion of information from a record in ACT

I have this field that fairly consistently produces the same results minus a bit of text we need to pull out. Here is an example of the first record all we need out of it is the word "test" at the end.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 Test\par
}

Another example below we need the record the words "I wish I was in the land of cotton."

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 I wish I was in the land of cotton.\par
}

Does anyone know the best way the consistent way to get this out. Any ACT advisor my know a trick or a Crystal Guru my know the cure. Any support is greatly appreciated.
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Is it always fs17 before the text you need?

You could try this
Local STringVar myText;
myText := Split({YourField},'\fs17 ')[2];
Left(myText,Length(myText)-4)

mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Author Commented:
The length of the text will never be fixed so does that formula  adjust for "inflation and deflation" so to speak?
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Author Commented:
This is the error I get. How do we know what size the array should be?

Formula-Error.png
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

mlmccCommented:
The formula I gave you assumes you have \fs17 before the text you want and only \par after it.

If you have other possibilites then I need to look at representative data to see how to parse it out.

mlmcc
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Author Commented:
Can you identify why I am getting the array error? I should be able to maintain that text as long as I can control what the users choose as far as the font and style. What is between the \fs17    ........      and the \par should change based on the length of the statement they put in the ACT input window. So if you have that correct in the formula what woud cause the array error?
mlmccCommented:
It should work so long as there is a \fs17 with a space after it in the field.

Are any of the fields NULL?

mlmcc
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Author Commented:
There are a few records that show up differently and I see now why we will have to limit them in posting to the report. There are a few codes I can kick out and leave those records that have the unusual code out.
or
How would I create a series of multiple scenarios in the formula that would address other positions in a record that may be almost the same just not ending with "\fs17 Test\par". Whereby  "Test" is the word we want to print and the "\fs17" and "\par" surround it.
I can do basic formulas just not these layered multivariable stuff in Crystal Reports. I barely passed calculus but aced Physics, Biology and Organic Chemistry. That's a fact.
mlmccCommented:
You could do something like this assuming the \fs17 only shows when you want it to be used as the start point

Local STringVar myText;
If InStr({YourField},'\fs17') > 0 then
    myText := Split({YourField},'\fs17 ')[2]
Else If InStr({YourField},'\xxxx') > 0 then
    myText := Split({YourField},'\xxxx ')[2]
else
    MyText = "There is no data     ";

Left(myText,Length(myText)-4)

Add a condition for each special case and change the '\xxxx' to the appropriate value

mlmcc
RUA Volunteer2?Tableau Trainer & Consultant Sales Exec.Author Commented:
What can I say thanks for keeping me alive sir thanks for keeping me alive.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.