![](/img/trans.png)
[英]how to concatenate a string and cell value in excel if the string already has quotes?
[英]How to update/concatenate specific value in excel cell?
我已将以下请求存储在 A0 单元格中,现在我想使用 A1 单元格中存在的数据(123)更新“标签”值。 不确定如何连接或如何使用其他公式。 有人可以在这里帮忙吗?
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"
}
AFAIK,JSON 没有本机解析器/构建器。 下面的公式通过连接 1) 原始字符串从开始到(旧)值之前的 position、2) 新值、3) 值之后直到结尾的原始字符串来构造所需的字符串。 'A1' 之后的 """,", CHAR(10), " " 只是我处理换行符和缩进字符的方式,不一定是最佳的。
=CONCAT(LEFT(A0,FIND("tag"": ",A0)+LEN("tag"": ")),A1, """,", CHAR(10), " ", MID(A0, FIND("""tran",A0),1000))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.