BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
manishiiita
Quartz | Level 8

I have SAS Data set with one of the column defined in HTML format. I have to convert this HTML Column into Text format. I have used Perl based HTML parsers, but it is not working.

manishiiita_0-1627205939617.png

 

We have French Alphabet characters in above comments (first line; â, ê, î, ô, û); and it should be available as actual French text characters (â, ê, î, ô, û) post conversion.

Is there any way to do it in SAS?

If not in SAS programming, is there any way to show it as a report as we are displaying above data into a Stored Process report?

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

For the accents, you have to do that manually, for example using function TRANSTRN as function URLDECODE is rather limited. Unfinished even.

View solution in original post

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

So you want to remove html tags and just keep the text?

Or do you want to reuse the html as is in a SAS generated report?

 

manishiiita
Quartz | Level 8
I want to keep only the text from it. I'm going to show actual text in report. So, no need to reuse html.
ChrisNZ
Tourmaline | Level 20

How about removing tags with this simple (but not fail proof) syntax?

data T;
  HTML='<a>sfdsfdsf</a>sdsd';
  TEXT=prxchange('s/<[^>]*?>//',-1,HTML);
run;

 

ChrisNZ
Tourmaline | Level 20

For the accents, you have to do that manually, for example using function TRANSTRN as function URLDECODE is rather limited. Unfinished even.

Ksharp
Super User
Post some sample data and the output you want see, that would be better to explain your question.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1836 views
  • 3 likes
  • 3 in conversation