0

String example

[{"identifier" : "value1"},{"identifier" : "value2"}]

Desired output

value1,value2

I will be using powershell for this, have gone though the string and its methods but can't put my finger on how. Any and all help will be appreciated.

1 Answer 1

3

I think you should have provided more information in order to get a better answer. To solve your problem, you could deserialize the JSON(or load the file first) using the ConvertFrom-Json cmdlet, select the identifier property and finally -join the result:

('[{"identifier" : "value1"},{"identifier" : "value2"}]' | ConvertFrom-Json).identifier -join ','

Then you get your desired output:

value1,value2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.