Help with extracting text

What are you trying to achieve?

I am trying to extract text and input it into an airtable field for each. The text is from a chat gpt assistant output, in which I want each to be inputted into an airtable field (got the connection and fields synced) so I can export that as a CSV and upload it to a bulk flat file end point.

The issue I am having is that I can’t figure out how to extract just the text. I tried Chat GPT flows, but it is very inconsistent.

Here is a sample input:

Pinterest Pin Image Overlay:

  • Title: Tracking Amazon’s BSR? Think Again!

  • Short Description: Discover why Best Sellers Rank might not be the success metric you think it is.

  • List Title #1: Is BSR Deceptive?

  • List Description #1: BSR’s category-specific nature makes it hard to compare across categories. Results can be wildly inconsistent.

  • List Title #2: The Fluctuation Issue

  • List Description #2: BSR changes hourly based on short-term sales, creating a volatile and unreliable measure.

  • List Title #3: Profitability Blind Spot

  • List Description #3: It reveals nothing about profit margins or costs. High BSR doesn’t equal profitability.

  • List Title #4: Time-Travel Problem

  • List Description #4: BSR reflects past sales, not future potential. It’s the rear-view mirror of metrics.

Pinterest Pin Title:

  • Why BSR Might Be Misleading on Amazon

Pinterest Pin Description:

  • :shopping_cart: Tracking Best Sellers Rank (#BSR) on Amazon? Think it’s the ultimate success metric? :thinking: Think again! This can be misleading for several reasons. :tornado: From flaky category specifics to hourly fluctuations, BSR is fraught with issues. :no_entry_sign: Don’t get blindsided by this backward-looking measure. Instead, focus on sales volume, conversion rates, and profitability margins to truly understand your product’s performance. :trophy: MEH’s Our Name, Not Our Game—click now to unlock smarter metrics! :chart_with_upwards_trend::point_right:

Pinterest Tags:

  • AmazonMetrics
  • ECommerceTips
  • SalesSuccess
  • OnlineSelling
  • ProductPerformance

I need the text for each after the :

So I can input it into a cell in airtable

Steps taken so far

Images show what I have done so far. Any help is appreciated.

Also a text parser course would be very beneficial (can just link to a recommended one).

Screenshots: scenario setup, module configuration, errors


Welcome to the Make community!

Could you please format your “sample input”? This is because the forum will reformat your text if you do not put it between code blocks.

For more information, see below

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 ()
– emojis
– 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!

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

#### **Pinterest Pin Image Overlay**:
- **Title**: Tracking Amazon's BSR? Think Again!
- **Short Description**: Discover why Best Sellers Rank might not be the success metric you think it is.

- **List Title #1**: Is BSR Deceptive?
- **List Description #1**: BSR's category-specific nature makes it hard to compare across categories. Results can be wildly inconsistent.
- **List Title #2**: The Fluctuation Issue
- **List Description #2**: BSR changes hourly based on short-term sales, creating a volatile and unreliable measure.
- **List Title #3**: Profitability Blind Spot
- **List Description #3**: It reveals nothing about profit margins or costs. High BSR doesn't equal profitability.
- **List Title #4**: Time-Travel Problem
- **List Description #4**: BSR reflects past sales, not future potential. It's the rear-view mirror of metrics.

#### **Pinterest Pin Title**:
- Why BSR Might Be Misleading on Amazon 

#### **Pinterest Pin Description**:
- 🛒 Tracking Best Sellers Rank (#BSR) on Amazon? Think it's the ultimate success metric? 🤔 Think again! This can be misleading for several reasons. 🌪️ From flaky category specifics to hourly fluctuations, BSR is fraught with issues. 🚫 Don't get blindsided by this backward-looking measure. Instead, focus on sales volume, conversion rates, and profitability margins to truly understand your product's performance. 🏆 MEH's Our Name, Not Our Game—click now to unlock smarter metrics! 📈👉

#### **Pinterest Tags**:
- AmazonMetrics
- ECommerceTips
- SalesSuccess
- OnlineSelling
- ProductPerformance
-

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of five modules:

Give it a go and let us know if you have any issues!

First, you can split the sections up by using this:

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

(?:\**(?<section_title>[^:*]+):?\**:?\s+(?<section_value>(?:- .+\s+)+))

Proof

https://regex101.com/r/FdxpCi/3

Important Info

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

Screenshot

Screenshot_2024-07-08_210721

Output


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!

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

2 Likes

Next, you need a second Match Pattern module to match sub-sections within a section “header”.

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

\**(?<key>[^*:]+)\**: (?<value>.+)

Proof

https://regex101.com/r/UEw9I2/1

Important Info

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

Screenshot

Screenshot_2024-07-08_210738

Output


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!

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Step 3

You aggregate sub-sections

Step 4

You convert sub-sections to a collection for easier mapping later

Step 5

You aggregate sections

Output of step 5

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

2 Likes

Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 103,
                    "module": "regexp:Parser",
                    "version": 1,
                    "parameters": {
                        "pattern": "(?:\\**(?<section_title>[^:*]+):?\\**:?\\s+(?<section_value>(?:- .+\\s+)+))",
                        "global": true,
                        "sensitive": true,
                        "multiline": false,
                        "singleline": false,
                        "continueWhenNoRes": false,
                        "ignoreInfiniteLoopsWhenGlobal": false
                    },
                    "mapper": {
                        "text": "{{102.value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 239,
                            "y": -2211,
                            "name": "Match Sections"
                        },
                        "restore": {
                            "parameters": {
                                "sensitive": {
                                    "collapsed": true
                                },
                                "multiline": {
                                    "collapsed": true
                                },
                                "singleline": {
                                    "collapsed": true
                                },
                                "continueWhenNoRes": {
                                    "collapsed": true
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "pattern",
                                "type": "text",
                                "label": "Pattern",
                                "required": true
                            },
                            {
                                "name": "global",
                                "type": "boolean",
                                "label": "Global match",
                                "required": true
                            },
                            {
                                "name": "sensitive",
                                "type": "boolean",
                                "label": "Case sensitive",
                                "required": true
                            },
                            {
                                "name": "multiline",
                                "type": "boolean",
                                "label": "Multiline",
                                "required": true
                            },
                            {
                                "name": "singleline",
                                "type": "boolean",
                                "label": "Singleline",
                                "required": true
                            },
                            {
                                "name": "continueWhenNoRes",
                                "type": "boolean",
                                "label": "Continue the execution of the route even if the module finds no matches",
                                "required": true
                            },
                            {
                                "name": "ignoreInfiniteLoopsWhenGlobal",
                                "type": "boolean",
                                "label": "Ignore errors when there is an infinite search loop",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "text",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "interface": [
                            {
                                "type": "text",
                                "name": "section_title",
                                "label": "section_title"
                            },
                            {
                                "type": "text",
                                "name": "section_value",
                                "label": "section_value"
                            },
                            {
                                "type": "uinteger",
                                "name": "i",
                                "label": "i"
                            },
                            {
                                "type": "any",
                                "name": "__IMTMATCH__",
                                "label": "Fallback Match"
                            }
                        ]
                    }
                },
                {
                    "id": 104,
                    "module": "regexp:Parser",
                    "version": 1,
                    "parameters": {
                        "pattern": "\\**(?<key>[^*:]+)\\**: (?<value>.+)",
                        "global": true,
                        "sensitive": true,
                        "multiline": false,
                        "singleline": false,
                        "continueWhenNoRes": false,
                        "ignoreInfiniteLoopsWhenGlobal": false
                    },
                    "mapper": {
                        "text": "{{103.section_value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 483,
                            "y": -2212,
                            "name": "Match sub-sections"
                        },
                        "restore": {},
                        "parameters": [
                            {
                                "name": "pattern",
                                "type": "text",
                                "label": "Pattern",
                                "required": true
                            },
                            {
                                "name": "global",
                                "type": "boolean",
                                "label": "Global match",
                                "required": true
                            },
                            {
                                "name": "sensitive",
                                "type": "boolean",
                                "label": "Case sensitive",
                                "required": true
                            },
                            {
                                "name": "multiline",
                                "type": "boolean",
                                "label": "Multiline",
                                "required": true
                            },
                            {
                                "name": "singleline",
                                "type": "boolean",
                                "label": "Singleline",
                                "required": true
                            },
                            {
                                "name": "continueWhenNoRes",
                                "type": "boolean",
                                "label": "Continue the execution of the route even if the module finds no matches",
                                "required": true
                            },
                            {
                                "name": "ignoreInfiniteLoopsWhenGlobal",
                                "type": "boolean",
                                "label": "Ignore errors when there is an infinite search loop",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "text",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "interface": [
                            {
                                "type": "text",
                                "name": "key",
                                "label": "key"
                            },
                            {
                                "type": "text",
                                "name": "value",
                                "label": "value"
                            },
                            {
                                "type": "uinteger",
                                "name": "i",
                                "label": "i"
                            },
                            {
                                "type": "any",
                                "name": "__IMTMATCH__",
                                "label": "Fallback Match"
                            }
                        ]
                    }
                },
                {
                    "id": 105,
                    "module": "builtin:BasicAggregator",
                    "version": 1,
                    "parameters": {
                        "feeder": 104
                    },
                    "mapper": {
                        "key": "{{104.key}}",
                        "value": "{{104.value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 735,
                            "y": -2213
                        },
                        "restore": {
                            "extra": {
                                "feeder": {
                                    "label": "Match sub-sections - Match pattern [104]"
                                },
                                "target": {
                                    "label": "Custom"
                                }
                            }
                        }
                    }
                },
                {
                    "id": 106,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "section values",
                        "scope": "roundtrip",
                        "value": "{{toCollection(105.array; \"key\"; \"value\")}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 979,
                            "y": -2212
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "section values",
                                "label": "section values",
                                "type": "any"
                            }
                        ]
                    }
                },
                {
                    "id": 107,
                    "module": "builtin:BasicAggregator",
                    "version": 1,
                    "parameters": {
                        "feeder": 103
                    },
                    "mapper": {
                        "section values": "{{106.`section values`}}",
                        "section_title": "{{103.section_title}}",
                        "section_value": "{{103.section_value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 1231,
                            "y": -2212,
                            "messages": [
                                {
                                    "category": "last",
                                    "severity": "warning",
                                    "message": "A transformer should not be the last module in the route."
                                }
                            ]
                        },
                        "restore": {
                            "extra": {
                                "feeder": {
                                    "label": "Match Sections - Match pattern [103]"
                                },
                                "target": {
                                    "label": "Custom"
                                }
                            }
                        }
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like