Text to JSON string


Text :
My name is Kitty.
I like “RPA”.

My name is Kitty./nI like /“RPA/”.

This is not at all a JSON format @Kitty

Can you make the question a bit clear

Thank you for your question. I am sorry for my blurry question.
May I know do you call the format below?
I want to change my text message to the following format.
Please teach me.

“text”: “\n◆関東遅延情報 8月7日 08時17分\nhttps:\/\/transit.yahoo.co.jp\/traininfo\/area\/4\/\n━─━─━─━─━─━─━─━\n内房線\n\n袖ケ浦~巌根駅間で踏切内点検を…\n━─━─━─━─━─━─━─━\n京葉線\n\n武蔵野線内で発生した線路内立入…\n━─━─━─━─━─━─━─━\n武蔵野線\n\n南浦和駅で発生した線路内立入の…\n━─━─━─━─━─━─━─━\n東武アーバンパークライン\n\n05:45頃、七光台駅構内で発…\n━─━─━─━─━─━─━─━\nシーサイドライン\n\n6月1日、新杉田駅で発生した衝…\n━─━─━─━─━─━─━─━”,
“ts”: “1565133474.000100”,

Hi @Kitty

Try to use deserialize json activity

Based on that you can convert it


Can you post the text you have @Kitty/

Thank you for your answer. Thats converting JSON string to JSON object right?
I will remember this.

I’m sorry I think my questions were inaccurate.
I want to convert my text (.txt) to JSON string (str) format.

1 Like

Hi thank you Mr Hareesh.
I want to convert my text to JSON string.
I have alot of text which I want to convert to JSON object but before it I need the text to be in string format. I do not know the proper term which we call them.

One example of my text is
My name is Kitty.
I am not a “cat”!

I want it to convert to
My name is Kitty.\r\nI am not a “cat”!

Again this is not a JSON format @Kitty

The JSON of this should be like this

" My name is Kitty"
“I am not a “cat”!”

Or you can write them in a single object also

Or even arrays, But the one you are posting is not a JSON string :slight_smile:

Please let me know the correct type of JSON you need and

I have never tried of converting text to JSON , but it is very interesting to try and learn that

Thank you so much for your kind explanation.

I am not an engineer so I do not know the term you call it.
What I want is as follows

My name is Kitty.
I am not a “cat”!

“My name is Kitty.\nI am not a “cat”!”

.toStr doesnt work as the output does not include \n.
Do you know where can I find the code to do the conversion?

Please help me.

So, you want the every line of the text you have in a single line with \n appended after every line @Kitty

Am I right?

Yeah thats right.

I am not sure of other rules.
For example if the message contains ", I need to put \ in front of the "
Or, if the message contains , I need to add \ in front of the .

ReadTextFIle.xaml (7.0 KB)

This is the workflow which will give you the expected output @Kitty,

I mean read the text and give you the string in a single line with \n appended

get back to me if you have any other doubts

1 Like

Hi. Thanks so much for the file Mr Hareesh.
You are a lifesaver

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.