question

Upvotes
Accepted
1 0 3 4

How to remove formatting characters amid text body of news when retrieving real time news data using MRN_STORY

Hi, one customer called me to ask the question. How to remove those invisible formatting characters amid those printable text words? Because sometimes the re-organized news story body looks like mess because of those special formatting characters. How to typeset those news body text words in order?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apimrn
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Liheng.Wang

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@Liheng.Wang

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

1 Answer

· Write an Answer
Upvotes
Accepted
17.2k 82 39 63

Hi @Liheng.Wang,

Can you elaborate what you mean by "invisible formatting characters"? The story body text can be determined by the mimeType defined within the JSON data structure - plain text.

Stories do contain <CR><LF> (Carriage Return/Line feeds) which is used for display terminals. In addition, stories can be nativly represented in other language variants. Can you also elaborate what "typeset those news body text words in order"? You mean you want to filter out certain ASCII characters like <CR> <TAB> <LF>, etc? If so, you will need to parse the body of the text and apply your own filtering.


ahs.png (31.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@nick.zincone.1, thank you so much for answer. Yes, that is what I exactly mean. The customer said those ASCII characters are not good enough to phrase the news body and sometimes it will make the news looking like a mess. So they want to remove all this characters and then re-construct them by its own based on the plain text. So the answer is, how to identify all these characters and filter out all of them? I believe the problem they have is about how to make the news body a purely plain text.

Hello @Liheng.Wang
Those control characters are generated from MRN data feed, not from the API or TREP. They are part of news story content and the API just sends it to the client application "as is". If the client wants to remove those ascii characters, the client needs to implement their own filter to detect and remove them in the application level.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.