Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4910 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

Text parsing is not one of my strong points! I need to be able to take tagged text and convert it to formatted text and there can be 0 to many tags in one line to multiple paragraphs.

The tags are <RD>, </RD> for red text, <B>, </B> for bold, and <I>, </I> for Italic.

An example may look like:

<RD>This text will be red.</RD>

The text in this line will be black.

<B>The text here is bold</B> and

this text is black again, then

<I>this text is italicized.</I>

Formatted it would look like:

This text will be red.

The text in this line will be black.

The text here is bold and

this text is black again, then

this text is italicized.

Any ideas on how to process this would be greatly appreciated,

TIA,

John

Posted

Try =

Let ( [ 

formula = Substitute ( "" & Quote ( text ) & "" ; 

[ "<RD>" ;  Quote ( " & TextColor ( " ) ] ;

[ "</RD>" ;  Quote ( " ; 16646400 ) & " ) ] ;

[ "<B>" ;  Quote ( " & TextStyleAdd ( " ) ] ;

[ "</B>" ;  Quote ( " ; bold ) & " ) ] ;

[ "<I>" ;  Quote ( " & TextStyleAdd ( " ) ] ;

[ "</I>" ;  Quote ( " ; italic ) & " ) ] )

] ;

Evaluate ( formula )

)

Posted

This works fantastic, thank you! I was thinking of something far more complex than this!

I definitely need to spend time with the "Let" and "Evaluate" functions!

Thanks again.

John

Try =

Let ( [ 

formula = Substitute ( "" & Quote ( text ) & "" ; 

[ "<RD>" ;  Quote ( " & TextColor ( " ) ] ;

[ "</RD>" ;  Quote ( " ; 16646400 ) & " ) ] ;

[ "<B>" ;  Quote ( " & TextStyleAdd ( " ) ] ;

[ "</B>" ;  Quote ( " ; bold ) & " ) ] ;

[ "<I>" ;  Quote ( " & TextStyleAdd ( " ) ] ;

[ "</I>" ;  Quote ( " ; italic ) & " ) ] )

] ;

Evaluate ( formula )

)

This topic is 4910 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.