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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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