We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
不知道您将其用作示例的数据行被存储在哪里,因此我假设它在环境变量
line
中。至于
链接
- 您可以指定您的意思是哪个字段,或者也许是指指定为数据项public_url
的链接。因此 - 假设您的数据在
line
中,请使用字符串replace删除{
,[
等。 /em>,然后每个“:”
“”,“” 并遵循弹跳球...设置<<代码>未定义的(只是一个有意义的字符串,没有魔术)和过程
line
,用简单的作为循环的简单作为可能引用的令牌的顺序。Echo %% E
命令仅用于显示以允许评估令牌。nistion_next
在循环之前 nothing匹配定义的变量,然后接下来的令牌包含所需的数据,因此将
nistion_next
设置为 name 可以分配下一步标记的变量。如果定义了
nistion_next
,则将当前令牌分配给nistion_next
中包含的variablename。...并使用
SET
显示结果。No idea where the data line you've used as an example is stored, so I've assumed it's in an environment variable
line
.As for what you mean by
the link
- you could have specified which field you mean, or perhaps you mean the link specified as the data itempublic_url
.So - assuming your data is in
line
, use string-replace to delete{
,[
, etc. by replacing by nothing, then each":"
by","
and follow the bouncing ball...Set the name(s) of the field(s) required to
undefined
(just a meaningful string, nothing magic) and processline
with a simplefor
loop as a sequence of possibly-quoted tokens separated by commas.The
echo %%e
command is simply for show to allow the token being evaluated to be seen.assign_next
is "set" to nothing before thefor
loop, so it will start as not definedIf a token matches a defined variable, then the next token contains the desired data, so set
assign_next
to the name of the variable to which to assign the next token.If
assign_next
is defined, then assign the current token to the variablename contained inassign_next
.... and display results using
set
.