如何在 excel 单元格中 update/concatenate 指定值?

How to update/concatenate specific value in excel cell?

我在 A0 单元格中存储了以下请求,现在我想用 A1 单元格中存在的数据 (123) 更新 'tag' 值。不确定如何连接或如何使用其他公式。有人可以帮忙吗?

Request in A0 Cell:
    {
      "merchant_ref": "xxx-xxxx",
      "tag": "789",     //Value(789) is not constant. May differ next request/cell.
      "transaction_type": "xx",
      "method": "xxxx",
      "amount": "xxxx",
      "currency_code": "xxx"
    }


Data in A1 Cell:
123


What i am expecting in A2 Cell:
    {
      "merchant_ref": "xxx-xxxx",
      "tag": "123", 
      "transaction_type": "xx",
      "method": "xxxx",
      "amount": "xxxx",
      "currency_code": "xxx"
    }

据我所知,JSON 没有本地 parser/builder。以下公式通过连接 1) 从开始到(旧)值之前的位置的原始字符串,2)新值,3)值之后的原始字符串直到结束来构造所需的字符串。 'A1' 之后的 """, CHAR(10), " " 只是我处理换行符和缩进字符的方式,不一定是最佳的。

=CONCAT(LEFT(A0,FIND("tag"": ",A0)+LEN("tag"": ")),A1, """,", CHAR(10), "      ", MID(A0, FIND("""tran",A0),1000))