How to split text?

Hi,
how to split text refer message?

i need split 4 prompt and send to telegram.

Hello @tuanpakya,

Is there any possibility to update the service that’s calling this webhook and use different characters?

Otherwise, you can probably just use a replace() function on that whole text and, specify those boxed digits as characters to search for, then replace them with something simple like a {{newline}}.

1 Like

Does it always say “–ar 53:63” before prompts number 2, 3, 4 ?

If yes, you can simply use split(text; separator) , where the separator is “–ar 53:63”

1 Like

Great option too. They will be left with the boxed digit at the beginning of each element, but maybe that can be removed by another function.

how to setup this flow? need add any module?

icon 1,2,3 and 4 static but prompt just different.

Example prompt :
:one: A baby is dressed as the hero “FRE repository” in a black and red cape with a white background. The happy baby has a mask covering its eyes and is smiling and looking at the camera in a full body shot with a funny pose. --ar 53:63 :two: baby dressed as super hero, with a red cape and black mask smiling in front of a white background, in the style of photo realistic, stock photography, with professional studio lighting --ar 53:63 :three: baby dressed as the super hero “FRERM” is drastically smiling and looking at the camera, against a white background. The baby is wearing a red cape with a black mask on his face, and has short hair in a full body shot. The style is funny and cartoon-like, with high resolution and high quality as a PNG file. --ar 53:63 :four: Cute baby dressed as the superhero “FREEPSVG” wearing a red cape and black mask, on a white background, in a full body shot, smiling with an open mouth, looking at the camera, with legs outstretched to either side, arms raised in an action pose, ready for adventure, in the style of Pixar with bright cartoon illustration colors, high resolution, high detail, high quality, high definition. --ar 53:63

Welcome to the Make community!

1. This forum might have or already changed your text

When pasting text into this forum, you should format the example text using the rich-text editor, otherwise the forum software might modify the displayed text, and you might get incorrect answers from others because of it.

Some things this forum software might do to mangle your text:

– remove extra spaces (which may be necessary)
– convert links to titles (when copied is incorrect)
– incorrect joined links
– convert single and double quotes to smart angled quotes ()
– convert emojis to shorthand (e.g.: :one: and display it incorrectly)
– etc.

This interferes with you receiving correct answers, because it:

– makes JSON invalid (you can verify when copy-paste into https://jsonformatter.org)
– makes incorrect text examples when we need to build a pattern for text parsing

2. To prevent this in future, please format text in code blocks

A. Type code fence manually
Either add three backticks ``` before and after the text, like this:

```
content goes here
```

B. Highlight and click the format button
Or use the format code button in the editor:
Screenshot_2023-10-02_191027

3. You might need to re-copy the original text

Once the post has been submitted, it’s too late to format it since it’s already butchered, and you need to make a re-copy of the text, and format it before submitting the forum post.

Please let us know once you have corrected the issue. This will avoid others potentially providing wrong answers based on incorrect text in your question.

Thank you!

2 Likes
:one: A baby is dressed as the hero “FRE repository” in a black and red cape with a white background. The happy baby has a mask covering its eyes and is smiling and looking at the camera in a full body shot with a funny pose. --ar 53:63 :two: baby dressed as super hero, with a red cape and black mask smiling in front of a white background, in the style of photo realistic, stock photography, with professional studio lighting --ar 53:63 :three: baby dressed as the super hero “FRERM” is drastically smiling and looking at the camera, against a white background. The baby is wearing a red cape with a black mask on his face, and has short hair in a full body shot. The style is funny and cartoon-like, with high resolution and high quality as a PNG file. --ar 53:63 :four: Cute baby dressed as the superhero “FREEPSVG” wearing a red cape and black mask, on a white background, in a full body shot, smiling with an open mouth, looking at the camera, with legs outstretched to either side, arms raised in an action pose, ready for adventure, in the style of Pixar with bright cartoon illustration colors, high resolution, high detail, high quality, high definition. --ar 53:63

can give me example flow?

can give me example flow and module.

Here was my thought:
use regular expression (Text parser Replace) and replace instances of :one:, :two:, etc… with {{newline}} then split that result by {{newline}}.

Please see blueprint for example.
how-to-split-text-39599.json (6.6 KB)

There are quite a few ways to handle this, though.

6 Likes

thanks. worked this flow.

2 Likes