BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

Hello, I have an xml file which contains emoji and I looking for a Unix or a SAS solution the remove those from the original xml file before making any treatment on it.

 

Does someone already works on that topic.

Regards

1 REPLY 1
Tom
Super User Tom
Super User

@alepage wrote:

Hello, I have an xml file which contains emoji and I looking for a Unix or a SAS solution the remove those from the original xml file before making any treatment on it.

 

Does someone already works on that topic.

Regards


Exactly what character is it?  What is the hexcode?

For example is it a smiley face

data test;
  emoji = 'F09F988A'x ;
run;

proc print;
run;

Tom_0-1720051208649.png

Once you know what character you are looking for try reading through the file and changing it to something else.

data _null_;
  infile 'bad.xml';
  file 'good.xml';
  input;
  _infile_ = tranwrd('F09F988A'x,':)');
  put _infile_;
run;

Note if any of the lines in the XML are longer than 32K bytes then the code to find and replace the "emoji" character(s) will need to be more complicated.

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 616 views
  • 2 likes
  • 2 in conversation