Replies: 6 comments
-
You need to convert 'aitem' to an array (yq knew yq -p=x -o=j '.aitem |= [.]' test.xml |
Beta Was this translation helpful? Give feedback.
-
Any idea can i create xsd schema file & ask command to do accordingly as per schema file.Requirement as below , would need two tasks doing in single command.
Below is the output, missed marking array at main "aitem" but creating an extra "aitem" with null at last
|
Beta Was this translation helpful? Give feedback.
-
I already answered the double quoting question here: #1478 You can give yq multiple commands by using the You can give multiple paths to a command using comma:
|
Beta Was this translation helpful? Give feedback.
-
@mikefarah
|
Beta Was this translation helpful? Give feedback.
-
Ah the real |
Beta Was this translation helpful? Give feedback.
-
Hi @mikefarah Could you please correct the command
Defining below tree elements to be a mandatory array , But if multiple set of 'lineItems' with 'itemCodes' are there then its failing.
|
Beta Was this translation helpful? Give feedback.
-
Generate array always for specified xml element "aitem" even with single set
Command used
yq -p=x -o=j test.xml
Command Output
Expected Output
Beta Was this translation helpful? Give feedback.
All reactions