Search code examples
regexgoogle-sheetsgoogle-sheets-formulaspreadsheetre2

Split text in google sheet on multiple conditions


I want to split the text on multiple conditions.

Here is sheet

this is the text that I want to split.

[{ name : Lot 230: Condition 1 Waterproof Protective Hard Case with Foam, Orange 9\ x 7\ x 4\ Watertight IP67 Dust Proof and Shock Proof TSA Approved Portable Carrier , item_id :8259332, bid_id :113235886, single_amount : 10.0 , amount : 10.0 , quantity :1, charges_amount : 1.3 , buyers_charge_id :361, tax_amount : 0.9 , tax_rate_id :161, total_amount : 12.2 , removed :null, removed_reason :null},{ name : Lot 253: Honeywell Home RTH9585WF1004 Wi-Fi Smart Color Thermostat, 7 Day Programmable, Touch Screen, Energy Star, Alexa Ready, Gray , item_id :8259353, bid_id :113236249, single_amount : 12.0 , amount : 12.0 , quantity :1, charges_amount : 1.56 , buyers_charge_id :361, tax_amount : 1.08 , tax_rate_id :161, total_amount : 14.64 , removed :null, removed_reason :null}]

Text can have information about many products. As you can see above text have information about 2 products. I just want the names of both products in separate columns.

Col1:

Lot 230: Condition 1 Waterproof Protective Hard Case with Foam, Orange 9\ x 7\ x 4\ Watertight IP67 Dust Proof and Shock Proof TSA Approved Portable Carrier

Col2:

Lot 253: Honeywell Home RTH9585WF1004 Wi-Fi Smart Color Thermostat, 7 Day Programmable, Touch Screen, Energy Star, Alexa Ready, Gray


Solution

  • try:

    =ARRAYFORMULA(IFERROR(REGEXREPLACE(SPLIT(REGEXREPLACE(A3:A, 
     "^\[", ), "{ name : ", ), " , item_id.*$", )))
    

    enter image description here