CHATGPT to Mutiple bundles - Getting a long text to different bundles or arrays

Hi.

My goal is to separate the outputs, one named “total pris” and one “nr”
these two is gonna have different number outputs in the finished scenario (so dynamic i believe). I want to be able to use the two numbers independent of each other. “Total pris” and “nr” is gonna be some kind of firm text bundle. Like “max tokens” “temperature” “number” etc. as seen in the screenshot.

I want those to be like this:
image
Ignore the actual names here ( i mean the structure)

Bundle 1:
Total pris: — 2.125,01
Nr: — 1589

I want to do this so i later on can pick each separately. I hope this makes sense. I have tried with regular expression but I’m very lost.

When reaching out for assistance with your regex pattern for a Text Parser module, it would be super helpful if you could share the actual text you’re trying to match (as text). Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.

Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets. Thanks a bunch!

2 Likes

Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Total pris: (?<total_pris>[\d.,]+)\sNr: (?<nr>\d+)

Proof

https://regex101.com/r/oLSPfx

Important Info

  • :warning: Global match must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

2 Likes